LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr

This commit is contained in:
Linus Groh 2022-12-14 17:40:33 +00:00 committed by Tim Flynn
commit 22089436ed
Notes: sideshowbarker 2024-07-17 08:55:54 +09:00
161 changed files with 367 additions and 370 deletions

View file

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