1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 17:05:06 +00:00

LibWeb: Introduce the Environment Settings Object

The environment settings object is effectively the context a piece of
script is running under, for example, it contains the origin,
responsible document, realm, global object and event loop for the
current context. This effectively replaces ScriptExecutionContext, but
it cannot be removed in this commit as EventTarget still depends on it.

https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
This commit is contained in:
Luke Wilde 2021-10-14 16:12:53 +01:00 committed by Linus Groh
parent 4db5406d62
commit f71f404e0c
29 changed files with 883 additions and 86 deletions

View file

@ -99,6 +99,16 @@
} __testjs_common_run_file {}; \
::Test::JS::IntermediateRunFileResult __TestJS_run_file::hook(__VA_ARGS__)
#define TESTJS_CREATE_INTERPRETER_HOOK(...) \
struct __TestJS_create_interpreter_hook { \
__TestJS_create_interpreter_hook() \
{ \
::Test::JS::g_create_interpreter_hook = hook; \
} \
static NonnullOwnPtr<JS::Interpreter> hook(); \
} __testjs_create_interpreter_hook {}; \
NonnullOwnPtr<JS::Interpreter> __TestJS_create_interpreter_hook::hook(__VA_ARGS__)
namespace Test::JS {
namespace JS = ::JS;
@ -128,6 +138,7 @@ extern String g_test_root;
extern int g_test_argc;
extern char** g_test_argv;
extern Function<void()> g_main_hook;
extern Function<NonnullOwnPtr<JS::Interpreter>()> g_create_interpreter_hook;
extern HashMap<bool*, Tuple<String, String, char>> g_extra_args;
struct ParserError {