summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Node.cpp
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-01-16 13:16:04 +0100
committerLinus Groh <mail@linusgroh.de>2022-01-22 01:21:18 +0000
commit631bbcd00a32773aa22ece270ba00628c1240d4c (patch)
treea12959a306d8a47ffe3f343942e69b9f4abb2a82 /Userland/Libraries/LibWeb/DOM/Node.cpp
parent232a8432b7f879140c50df8114b7467f45e99349 (diff)
downloadserenity-631bbcd00a32773aa22ece270ba00628c1240d4c.zip
LibJS: Refactor interpreter to use Script and Source Text Modules
This also refactors interpreter creation to follow InitializeHostDefinedRealm, but I couldn't fit it in the title :^) This allows us to follow the spec much more closely rather than being completely ad-hoc with just the parse node instead of having all the surrounding data such as the realm of the parse node. The interpreter creation refactor creates the global execution context once and doesn't take it off the stack. This allows LibWeb to take the global execution context and manually handle it, following the HTML spec. The HTML spec calls this the "realm execution context" of the environment settings object. It also allows us to specify the globalThis type, as it can be different from the global object type. For example, on the web, Window global objects use a WindowProxy global this value to enforce the same origin policy on operations like [[GetOwnProperty]]. Finally, it allows us to directly call Program::execute in perform_eval and perform_shadow_realm_eval as this moves global_declaration_instantiation into Interpreter::run (ScriptEvaluation) as per the spec. Note that this doesn't evalulate Source Text Modules yet or refactor the bytecode interpreter, that's work for future us :^) This patch was originally build by Luke for the environment settings object change but was also needed for modules. So I (davidot) have modified it with the new completion changes and setup for that. Co-authored-by: davidot <davidot@serenityos.org>
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Node.cpp')
0 files changed, 0 insertions, 0 deletions