mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibJS: Convert Intrinsics::create() to NonnullGCPtr
This commit is contained in:
parent
237402aea9
commit
45f903da00
Notes:
sideshowbarker
2024-07-17 03:17:41 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/45f903da00 Pull-request: https://github.com/SerenityOS/serenity/pull/16479 Reviewed-by: https://github.com/davidot ✅
2 changed files with 3 additions and 3 deletions
|
@ -132,7 +132,7 @@ static void initialize_constructor(VM& vm, PropertyKey const& property_key, Obje
|
|||
}
|
||||
|
||||
// 9.3.2 CreateIntrinsics ( realmRec ), https://tc39.es/ecma262/#sec-createintrinsics
|
||||
Intrinsics* Intrinsics::create(Realm& realm)
|
||||
NonnullGCPtr<Intrinsics> Intrinsics::create(Realm& realm)
|
||||
{
|
||||
auto& vm = realm.vm();
|
||||
|
||||
|
@ -160,7 +160,7 @@ Intrinsics* Intrinsics::create(Realm& realm)
|
|||
add_restricted_function_properties(static_cast<FunctionObject&>(*realm.intrinsics().function_prototype()), realm);
|
||||
|
||||
// 4. Return unused.
|
||||
return intrinsics;
|
||||
return *intrinsics;
|
||||
}
|
||||
|
||||
void Intrinsics::initialize_intrinsics(Realm& realm)
|
||||
|
|
|
@ -15,7 +15,7 @@ class Intrinsics final : public Cell {
|
|||
JS_CELL(Intrinsics, Cell);
|
||||
|
||||
public:
|
||||
static Intrinsics* create(Realm&);
|
||||
static NonnullGCPtr<Intrinsics> create(Realm&);
|
||||
|
||||
Shape* empty_object_shape() { return m_empty_object_shape; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue