Replies: 1 comment
-
Closing since the current implementation fits our needs. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now when we're interpreting the AST we utilize
JsResult
as a wrapper for any error that originates on execution. This has its advantages; we can propagate type errors andthrow
errors with?
and return any value generated from a native function with ease. However, #672 showed us that having no distinction between a value returned from a native function and a value returned from AST interpretation is suboptimal.The spec solves this problem with
Completion Records
, which are a way to separate values generated from native functions and values generated from the execution of Javascript code.This technique also allows us to eliminate
InterpreterState
from theContext
, essentially removing state that we needed to maintain by hand, like in:boa/boa/src/syntax/ast/node/return_smt/mod.rs
Lines 70 to 73 in a11a8a9
or
boa/boa/src/syntax/ast/node/statement_list/mod.rs
Lines 121 to 123 in a11a8a9
To implement
CompletionRecords
we would need to make a big refactor to the AST. The project Completion Records tracks the progress of this discussion and all the steps we would need to follow in order to refactor the AST.This feature should be developed in the https://github.com/boa-dev/boa/tree/feature/completion_records branch, to have some leisure of experimentation and to stabilize it separately from the master branch.
Beta Was this translation helpful? Give feedback.
All reactions