Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/echosoar/jsi
JSI is a JavaScript Interpreter written in Rust.
https://github.com/echosoar/jsi
compiler ecmascript es2020 es6 interpreter javascript javascript-ast-parser javascript-engine javascript-interpreter javascript-runtime parser test262
Last synced: 2 months ago
JSON representation
JSI is a JavaScript Interpreter written in Rust.
- Host: GitHub
- URL: https://github.com/echosoar/jsi
- Owner: echosoar
- Created: 2022-12-18T13:58:12.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-08T00:48:25.000Z (12 months ago)
- Last Synced: 2024-01-08T02:23:18.280Z (12 months ago)
- Topics: compiler, ecmascript, es2020, es6, interpreter, javascript, javascript-ast-parser, javascript-engine, javascript-interpreter, javascript-runtime, parser, test262
- Language: Rust
- Homepage:
- Size: 768 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## JSI
JSI is a JavaScript Interpreter written in Rust.
---
### Usage
```rust
use jsi::JSI;let mut jsi = JSI::new();
let result = jsi.run(String::from("\
let a = [];
let i = 0;
outer:
while(i < 3) {
i ++;
let j = 0;
while(j < 5) {
j ++;
if (j == 1 && i == 1) {
continue outer
}
if (j == 4) break
if (j == 3 && i == 2) {
break outer
}
a.push(i * j);
}
}
a.join(':')")
).unwrap();
assert_eq!(result , Value::String(String::from("2:4")));
```### Development
+ git submodule `git submodule update --init --recursive`
+ test262 `RUST_MIN_STACK=8388608 cargo test --package jsi --test test262_test -- test_all_262 --exact --nocapture`### Refs
+ Ecma Standard: https://tc39.es/ecma262/multipage/#sec-intro
+ Test262: https://github.com/tc39/test262---
by [echosoar](https://github.com/echosoar)