diff options
author | Luke Wilde <lukew@serenityos.org> | 2022-10-25 22:18:27 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-25 22:54:07 +0100 |
commit | 28bc3a76d916383c980b534c58b148c542ee4189 (patch) | |
tree | 103b0d2c702d4256f853f9ffb53c1b6efea76dfa | |
parent | a0c41fc3f0dda67a9ca220b889672e37ce412836 (diff) | |
download | serenity-28bc3a76d916383c980b534c58b148c542ee4189.zip |
LibWeb: Remove old assertion in host_enqueue_promise_job context hack
We no longer need to pull a global object from somewhere to push an
execution context onto the stack, so the assertion no longer makes
sense.
-rw-r--r-- | Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp b/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp index 23af392bd7..01d155af7e 100644 --- a/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp +++ b/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp @@ -247,10 +247,7 @@ JS::VM& main_thread_vm() } else { // FIXME: We need to setup a dummy execution context in case a JS::NativeFunction is called when processing the job. // This is because JS::NativeFunction::call excepts something to be on the execution context stack to be able to get the caller context to initialize the environment. - // Since this requires pushing an execution context onto the stack, it also requires a global object. The only thing we can get a global object from in this case is the script or module. - // To do this, we must assume script or module is not Empty. We must also assume that it is a Script Record for now as we don't currently run modules. // Do note that the JS spec gives _no_ guarantee that the execution context stack has something on it if HostEnqueuePromiseJob was called with a null realm: https://tc39.es/ecma262/#job-preparedtoevaluatecode - VERIFY(script_or_module.has<JS::NonnullGCPtr<JS::Script>>()); dummy_execution_context = JS::ExecutionContext { vm->heap() }; dummy_execution_context->script_or_module = script_or_module; vm->push_execution_context(dummy_execution_context.value()); |