javascript 0.3.0

A JavaScript engine implementation in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use javascript::*;

#[test]
fn for_of_destructuring_var_object() {
    let script = r#"
        var values = [{x:1},{x:2}];
        for (var {x} of values) { }
        x;
    "#;

    let result = evaluate_script(script, false, None::<&std::path::Path>).unwrap();
    assert_eq!(result, "2");
}