While implementing do..while loop i've noticed strange boa behavior. This test
#[test]
fn test_while_loop() {
let src = r#"
let a = 0;
while (a < 10) a = a + 1;
a
"#;
assert_eq!(exec(src), String::from("10"));
}
will run forever. Changing loop body to a += 1 makes test pass. Seems like using a = a + 1 does not assign rvalue to lvalue. This test fails too:
#[test]
fn test_addition() {
let src = r#"
let a = 0;
a = a + 1;
a
"#;
assert_eq!(exec(src), String::from("1"));
}
I haven't looked at it yet, as i have limited debug possibilities now (vs code in wsl remote mode does not support lldb and i can't build boa on native windows cause of some problem with jemalloc compilation). Waiting for wsl2.
And second thought: maybe it would be interesting to implement some timeout in tests, i found something looking good here: https://users.rust-lang.org/t/limit-execution-time-of-test/6687/3
Hmmm. Interesting, I will take look to see what causing this.
Good news! Found the bug. I will create a pr as soon as possible.
Most helpful comment
Good news! Found the bug. I will create a pr as soon as possible.