LibJS: Implement SetDefaultGlobalBindings as a standalone function

Instead of hardcoding all the property definitions in GlobalObject's
initialize() function, make it the standalone AO it is supposed to be
that can then be used by other global objects that don't inherit from
JS::GlobalObject.
This commit is contained in:
Linus Groh 2022-08-28 17:33:01 +01:00
commit 040e3abb1d
Notes: sideshowbarker 2024-07-17 07:39:22 +09:00
3 changed files with 103 additions and 81 deletions

View file

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