1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:28:13 +00:00

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
parent 2a66fc6cae
commit 22089436ed
161 changed files with 367 additions and 370 deletions

View file

@ -244,7 +244,7 @@ Result<NonnullGCPtr<SourceTextModule>, Vector<ParserError>> SourceTextModule::pa
// [[HostDefined]]: hostDefined, [[ECMAScriptCode]]: body, [[Context]]: empty, [[ImportMeta]]: empty,
// [[RequestedModules]]: requestedModules, [[ImportEntries]]: importEntries, [[LocalExportEntries]]: localExportEntries,
// [[IndirectExportEntries]]: indirectExportEntries, [[StarExportEntries]]: starExportEntries, [[DFSIndex]]: empty, [[DFSAncestorIndex]]: empty }.
return NonnullGCPtr(*realm.heap().allocate_without_realm<SourceTextModule>(
return realm.heap().allocate_without_realm<SourceTextModule>(
realm,
filename,
host_defined,
@ -255,7 +255,7 @@ Result<NonnullGCPtr<SourceTextModule>, Vector<ParserError>> SourceTextModule::pa
move(local_export_entries),
move(indirect_export_entries),
move(star_export_entries),
move(default_export)));
move(default_export));
}
// 16.2.1.6.2 GetExportedNames ( [ exportStarSet ] ), https://tc39.es/ecma262/#sec-getexportednames
@ -347,7 +347,7 @@ ThrowCompletionOr<void> SourceTextModule::initialize_environment(VM& vm)
// Note: This must be true because we use a reference.
// 5. 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());
// 6. Set module.[[Environment]] to env.
set_environment(environment);