LibJS: Return void from SetDefaultGlobalBindings

Aligning with spec change:

https://github.com/tc39/ecma262/commit/052def
This commit is contained in:
Shannon Booth 2024-11-02 18:50:58 +13:00 committed by Tim Flynn
parent 0a1c9e4038
commit b5536db915
Notes: github-actions[bot] 2024-11-03 12:50:21 +00:00
2 changed files with 4 additions and 5 deletions

View file

@ -95,8 +95,8 @@ GlobalObject::GlobalObject(Realm& realm)
Object::set_prototype(realm.intrinsics().object_prototype());
}
// 9.3.4 SetDefaultGlobalBindings ( realmRec ), https://tc39.es/ecma262/#sec-setdefaultglobalbindings
Object& set_default_global_bindings(Realm& realm)
// 9.3.3 SetDefaultGlobalBindings ( realmRec ), https://tc39.es/ecma262/#sec-setdefaultglobalbindings
void set_default_global_bindings(Realm& realm)
{
auto& vm = realm.vm();
@ -191,8 +191,7 @@ Object& set_default_global_bindings(Realm& realm)
global.define_direct_property(vm.names.InternalError, realm.intrinsics().internal_error_constructor(), attr);
global.define_direct_property(vm.names.console, realm.intrinsics().console_object(), attr);
// 3. Return global.
return global;
// 3. Return unused.
}
void GlobalObject::initialize(Realm& realm)

View file

@ -43,7 +43,7 @@ private:
JS_DECLARE_NATIVE_FUNCTION(unescape);
};
Object& set_default_global_bindings(Realm&);
void set_default_global_bindings(Realm&);
template<>
inline bool Object::fast_is<GlobalObject>() const { return is_global_object(); }