mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 23:52:07 +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
|
@ -51,7 +51,7 @@ ThrowCompletionOr<void> SyntheticModule::link(VM& vm)
|
|||
// Note: This must be true because we use a reference.
|
||||
|
||||
// 3. Let env be NewModuleEnvironment(realm.[[GlobalEnv]]).
|
||||
auto* environment = vm.heap().allocate_without_realm<ModuleEnvironment>(&realm().global_environment());
|
||||
auto environment = vm.heap().allocate_without_realm<ModuleEnvironment>(&realm().global_environment());
|
||||
|
||||
// 4. Set module.[[Environment]] to env.
|
||||
set_environment(environment);
|
||||
|
@ -139,7 +139,7 @@ NonnullGCPtr<SyntheticModule> SyntheticModule::create_default_export_synthetic_m
|
|||
};
|
||||
|
||||
// 2. Return CreateSyntheticModule("default", closure, realm)
|
||||
return *realm.heap().allocate_without_realm<SyntheticModule>(Vector<FlyString> { "default" }, move(closure), realm, filename);
|
||||
return realm.heap().allocate_without_realm<SyntheticModule>(Vector<FlyString> { "default" }, move(closure), realm, filename);
|
||||
}
|
||||
|
||||
// 1.4 ParseJSONModule ( source ), https://tc39.es/proposal-json-modules/#sec-parse-json-module
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue