mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:37:42 +00:00
LibJS: Pass Realm to define_native_{accessor,function}()
This is needed so that the allocated NativeFunction receives the correct realm, usually forwarded from the Object's initialize() function, rather than using the current realm.
This commit is contained in:
parent
7c468b5a77
commit
e3895e6c80
116 changed files with 893 additions and 890 deletions
|
@ -35,8 +35,8 @@ void JSONObject::initialize(Realm& realm)
|
|||
auto& vm = this->vm();
|
||||
Object::initialize(realm);
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(vm.names.stringify, stringify, 3, attr);
|
||||
define_native_function(vm.names.parse, parse, 2, attr);
|
||||
define_native_function(realm, vm.names.stringify, stringify, 3, attr);
|
||||
define_native_function(realm, vm.names.parse, parse, 2, attr);
|
||||
|
||||
// 25.5.3 JSON [ @@toStringTag ], https://tc39.es/ecma262/#sec-json-@@tostringtag
|
||||
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "JSON"), Attribute::Configurable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue