We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set your JS to this and then run
let a = 1;
You should get undefined as expected. But it will run with no errors
undefined
Leaving the JS the same run cargo run --features vm ../tests/js/test.js or Cargo Run (VM) on VSCode. You will reach an "unimplemented" error, arising from here: https://github.com/boa-dev/boa/blob/master/boa/src/vm/compilation.rs#L61
cargo run --features vm ../tests/js/test.js
Cargo Run (VM)
This is because Node::LetDeclList hasn't been implemented in this block https://github.com/boa-dev/boa/blob/master/boa/src/vm/compilation.rs#L42-L62
Node::LetDeclList
You can look at the spiderMonkey Op codes for inspiration, namely DefVar in https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/Bytecode
DefVar
Then you can add DefVar here: https://github.com/boa-dev/boa/blob/master/boa/src/vm/instructions.rs#L2-L60
Then here you can push the variable to the right environment, similar to how we do this here: https://github.com/boa-dev/boa/blob/master/boa/src/syntax/ast/node/declaration/let_decl_list/mod.rs#L44-L48
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Set your JS to this and then run
You should get
undefined
as expected. But it will run with no errorsLeaving the JS the same run
cargo run --features vm ../tests/js/test.js
orCargo Run (VM)
on VSCode.You will reach an "unimplemented" error, arising from here:
https://github.com/boa-dev/boa/blob/master/boa/src/vm/compilation.rs#L61
This is because
Node::LetDeclList
hasn't been implemented in this block https://github.com/boa-dev/boa/blob/master/boa/src/vm/compilation.rs#L42-L62Adding the instruction
You can look at the spiderMonkey Op codes for inspiration, namely
DefVar
in https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/BytecodeThen you can add
DefVar
here:https://github.com/boa-dev/boa/blob/master/boa/src/vm/instructions.rs#L2-L60
Implementing the instruction
Then here you can push the variable to the right environment, similar to how we do this here:
https://github.com/boa-dev/boa/blob/master/boa/src/syntax/ast/node/declaration/let_decl_list/mod.rs#L44-L48
The text was updated successfully, but these errors were encountered: