LibJS: Convert Intrinsics::create() to NonnullGCPtr

This commit is contained in:
Linus Groh 2022-12-13 20:49:50 +00:00
parent 237402aea9
commit 45f903da00
Notes: sideshowbarker 2024-07-17 03:17:41 +09:00
2 changed files with 3 additions and 3 deletions

View file

@ -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)

View file

@ -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; }