Skip to content
/ jsi Public

JSI is a JavaScript Interpreter written in Rust.

Notifications You must be signed in to change notification settings

echosoar/jsi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSI

JSI is a JavaScript Interpreter written in Rust.

test262 passed

test262 total


Usage

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


by echosoar