mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
LibJS+LibWeb: Restore type safety of Realm::set_global_object()
The changes from 8a03b17
to allow any JS::Value aren't a good fit, as
shown by the excessive amount of verify_cast needed :^)
This commit is contained in:
parent
64b29eb459
commit
c8f1651761
Notes:
sideshowbarker
2024-07-17 08:24:07 +09:00
Author: https://github.com/linusg
Commit: c8f1651761
Pull-request: https://github.com/SerenityOS/serenity/pull/14784
10 changed files with 27 additions and 36 deletions
|
@ -47,13 +47,11 @@ public:
|
|||
|
||||
interpreter->m_global_execution_context = MUST(Realm::initialize_host_defined_realm(
|
||||
vm,
|
||||
[&](Realm& realm) -> Value {
|
||||
[&](Realm& realm) -> GlobalObject* {
|
||||
global_object = interpreter->heap().allocate_without_global_object<GlobalObjectType>(realm, forward<Args>(args)...);
|
||||
return global_object;
|
||||
},
|
||||
[](Realm&) -> Value {
|
||||
return js_undefined();
|
||||
}));
|
||||
nullptr));
|
||||
|
||||
// NOTE: These are not in the spec.
|
||||
static FlyString global_execution_context_name = "(global execution context)";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue