mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
@@ -31,9 +31,9 @@ void StringConstructor::initialize(Realm& realm)
|
||||
define_direct_property(vm.names.prototype, realm.global_object().string_prototype(), 0);
|
||||
|
||||
u8 attr = Attribute::Writable | Attribute::Configurable;
|
||||
define_native_function(vm.names.raw, raw, 1, attr);
|
||||
define_native_function(vm.names.fromCharCode, from_char_code, 1, attr);
|
||||
define_native_function(vm.names.fromCodePoint, from_code_point, 1, attr);
|
||||
define_native_function(realm, vm.names.raw, raw, 1, attr);
|
||||
define_native_function(realm, vm.names.fromCharCode, from_char_code, 1, attr);
|
||||
define_native_function(realm, vm.names.fromCodePoint, from_code_point, 1, attr);
|
||||
|
||||
define_direct_property(vm.names.length, Value(1), Attribute::Configurable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user