mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:28:14 +00:00
LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr
This commit is contained in:
parent
2a66fc6cae
commit
22089436ed
161 changed files with 367 additions and 370 deletions
|
@ -36,7 +36,7 @@ NonnullGCPtr<NativeFunction> NativeFunction::create(Realm& allocating_realm, Saf
|
|||
// 7. Set func.[[Extensible]] to true.
|
||||
// 8. Set func.[[Realm]] to realm.
|
||||
// 9. Set func.[[InitialName]] to null.
|
||||
auto* function = allocating_realm.heap().allocate<NativeFunction>(allocating_realm, move(behaviour), prototype.value(), *realm.value());
|
||||
auto function = allocating_realm.heap().allocate<NativeFunction>(allocating_realm, move(behaviour), prototype.value(), *realm.value());
|
||||
|
||||
// 10. Perform SetFunctionLength(func, length).
|
||||
function->set_function_length(length);
|
||||
|
@ -48,12 +48,12 @@ NonnullGCPtr<NativeFunction> NativeFunction::create(Realm& allocating_realm, Saf
|
|||
function->set_function_name(name, prefix);
|
||||
|
||||
// 13. Return func.
|
||||
return *function;
|
||||
return function;
|
||||
}
|
||||
|
||||
NonnullGCPtr<NativeFunction> NativeFunction::create(Realm& realm, FlyString const& name, SafeFunction<ThrowCompletionOr<Value>(VM&)> function)
|
||||
{
|
||||
return *realm.heap().allocate<NativeFunction>(realm, name, move(function), *realm.intrinsics().function_prototype());
|
||||
return realm.heap().allocate<NativeFunction>(realm, name, move(function), *realm.intrinsics().function_prototype());
|
||||
}
|
||||
|
||||
NativeFunction::NativeFunction(SafeFunction<ThrowCompletionOr<Value>(VM&)> native_function, Object* prototype, Realm& realm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue