mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
LibJS: Pass prototype to Function constructors
This commit is contained in:
parent
205ac0090d
commit
f6d57c82f6
21 changed files with 66 additions and 24 deletions
|
@ -235,7 +235,7 @@ void Object::put(PropertyName property_name, Value value)
|
|||
|
||||
void Object::put_native_function(const FlyString& property_name, AK::Function<Value(Interpreter&)> native_function, i32 length)
|
||||
{
|
||||
auto* function = heap().allocate<NativeFunction>(property_name, move(native_function));
|
||||
auto* function = NativeFunction::create(interpreter(), interpreter().global_object(), property_name, move(native_function));
|
||||
function->put("length", Value(length));
|
||||
put(property_name, function);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue