1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00
serenity/Userland/Libraries/LibWeb/Bindings
Linus Groh 25909dcc05 LibWeb: Prepare to run callback in host_enqueue_promise_job()
...and clean up afterwards, of course. Additionally to preparing to run
a script, we also prepare to run a callback here. This matches WebIDL's
invoke_callback() / call_user_object_operation() functions, and prevents
a crash in host_make_job_callback() when getting the incumbent settings
object.

Running the following JS no longer crashes after this change:

```js
new Promise((resolve) => {
    setTimeout(resolve, 0);
}).then(() => {
    return Promise.reject();
});
```

See further discussion/investigation here:
9950196472
1026824624
1026922985

Many thanks to Luke for doing the hard work here, tracking this down,
and suggesting the fix!

Co-authored-by: Luke Wilde <lukew@serenityos.org>
2022-10-05 09:12:59 +01:00
..
AudioConstructor.cpp LibWeb: Use prototype and constructor methods from new Intrinsics 2022-10-01 21:05:32 +01:00
AudioConstructor.h LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions 2022-08-23 13:58:30 +01:00
CSSNamespace.cpp LibJS: Move intrinsics to the realm 2022-08-27 11:29:10 +01:00
CSSNamespace.h LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions 2022-08-23 13:58:30 +01:00
ExceptionOrUtils.h LibWeb: Support plain (throw) JS::Completion in WebIDL::ExceptionOr 2022-09-27 14:56:17 +01:00
HostDefined.cpp LibWeb: Move Web prototypes and constructors to new Intrinsics object 2022-10-01 21:05:32 +01:00
HostDefined.h LibWeb: Move Web prototypes and constructors to new Intrinsics object 2022-10-01 21:05:32 +01:00
ImageConstructor.cpp LibWeb: Use prototype and constructor methods from new Intrinsics 2022-10-01 21:05:32 +01:00
ImageConstructor.h LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions 2022-08-23 13:58:30 +01:00
Intrinsics.cpp LibWeb: Move Web prototypes and constructors to new Intrinsics object 2022-10-01 21:05:32 +01:00
Intrinsics.h LibWeb: Move Web prototypes and constructors to new Intrinsics object 2022-10-01 21:05:32 +01:00
LegacyPlatformObject.cpp LibWeb: Cleanup unecessary uses and includes of HTML::Window 2022-10-01 21:05:32 +01:00
LegacyPlatformObject.h LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated 2022-09-06 00:27:09 +02:00
LocationConstructor.cpp LibWeb: Use prototype and constructor methods from new Intrinsics 2022-10-01 21:05:32 +01:00
LocationConstructor.h LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions 2022-08-23 13:58:30 +01:00
LocationObject.cpp LibWeb: Use prototype and constructor methods from new Intrinsics 2022-10-01 21:05:32 +01:00
LocationObject.h LibWeb: Move cross-origin AOs from Bindings/ to HTML/CrossOrigin/ 2022-09-24 19:31:39 +01:00
LocationPrototype.h LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated 2022-09-06 00:27:09 +02:00
MainThreadVM.cpp LibWeb: Prepare to run callback in host_enqueue_promise_job() 2022-10-05 09:12:59 +01:00
MainThreadVM.h LibWeb: Remove the internal window object from WebEngineCustomData 2022-10-01 21:05:32 +01:00
NavigatorConstructor.cpp LibWeb: Use prototype and constructor methods from new Intrinsics 2022-10-01 21:05:32 +01:00
NavigatorConstructor.h LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions 2022-08-23 13:58:30 +01:00
NavigatorObject.cpp LibWeb: Use prototype and constructor methods from new Intrinsics 2022-10-01 21:05:32 +01:00
NavigatorObject.h LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions 2022-08-23 13:58:30 +01:00
NavigatorPrototype.h LibWeb: Cleanup unecessary uses and includes of HTML::Window 2022-10-01 21:05:32 +01:00
OptionConstructor.cpp LibWeb: Use prototype and constructor methods from new Intrinsics 2022-10-01 21:05:32 +01:00
OptionConstructor.h LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions 2022-08-23 13:58:30 +01:00
PlatformObject.cpp LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated 2022-09-06 00:27:09 +02:00
PlatformObject.h LibWeb: Use prototype and constructor methods from new Intrinsics 2022-10-01 21:05:32 +01:00
Replaceable.h LibJS: Remove GlobalObject from VM::this_value() 2022-08-23 13:58:30 +01:00
WindowConstructor.cpp LibWeb: Use prototype and constructor methods from new Intrinsics 2022-10-01 21:05:32 +01:00
WindowConstructor.h LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functions 2022-08-23 13:58:30 +01:00
WindowObjectHelper.h LibWeb: Add FileList from the FileAPI spec 2022-10-04 22:05:14 +02:00
WindowPrototype.h LibWeb: Use prototype and constructor methods from new Intrinsics 2022-10-01 21:05:32 +01:00