mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +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
|
@ -1117,6 +1117,7 @@ Object* create_mapped_arguments_object(VM& vm, FunctionObject& function, Vector<
|
|||
// 2. Let p be MakeArgSetter(name, env).
|
||||
// 3. Perform ! map.[[DefineOwnProperty]](! ToString(𝔽(index)), PropertyDescriptor { [[Set]]: p, [[Get]]: g, [[Enumerable]]: false, [[Configurable]]: true }).
|
||||
object->parameter_map().define_native_accessor(
|
||||
realm,
|
||||
PropertyKey { index },
|
||||
[&environment, name](VM& vm) -> ThrowCompletionOr<Value> {
|
||||
return MUST(environment.get_binding_value(vm, name, false));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue