1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 06:47:34 +00:00
serenity/Userland/Libraries/LibTest
Luke Wilde 631bbcd00a 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>
2022-01-22 01:21:18 +00:00
..
CMakeLists.txt Meta/LibTest: Build object libraries for test main files 2021-07-29 21:46:25 +01:00
CrashTest.cpp LibTest: Add EXPECT_NO_CRASH 2021-12-19 14:22:06 -08:00
CrashTest.h LibTest: Add EXPECT_CRASH_WITH_SIGNAL 2021-12-19 14:22:06 -08:00
JavaScriptTestRunner.h LibJS: Refactor interpreter to use Script and Source Text Modules 2022-01-22 01:21:18 +00:00
JavaScriptTestRunnerMain.cpp Everywhere: Remove unused ArgsParser header 2021-11-01 21:12:58 +01:00
Macros.h LibTest: Add EXPECT_NO_CRASH 2021-12-19 14:22:06 -08:00
Results.h Base+Utilities: Add run-tests program to run system tests with LibTest 2021-06-30 08:18:28 +04:30
TestCase.h LibTest: Add TEST_SETUP macro that runs before all test cases 2021-08-31 16:53:51 +02:00
TestMain.cpp AK+Userland: Move AK/TestSuite.h into LibTest and rework Tests' CMake 2021-04-25 09:36:49 +02:00
TestRunner.h LibTest: Decorate cleanup_and_exit() with [[noreturn]] 2021-09-14 21:41:51 +02:00
TestSuite.cpp LibTest: Add TEST_SETUP macro that runs before all test cases 2021-08-31 16:53:51 +02:00
TestSuite.h LibTest: Add TEST_SETUP macro that runs before all test cases 2021-08-31 16:53:51 +02:00