From d60e8c9df5d47ccd09d7a526d8c80e481179d9c7 Mon Sep 17 00:00:00 2001 From: networkException Date: Sat, 28 Oct 2023 23:45:38 +0200 Subject: [PATCH] LibJS: Add ModuleWithSpecifier for LoadedModules This patch adds ModuleWithSpecifier as the record type to be used in the LoadedModules field of Realm, Script and Cyclic Module Records. --- Userland/Libraries/LibJS/Forward.h | 1 + Userland/Libraries/LibJS/Runtime/ModuleRequest.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Userland/Libraries/LibJS/Forward.h b/Userland/Libraries/LibJS/Forward.h index d2f1c53cd35..64f5bc6991a 100644 --- a/Userland/Libraries/LibJS/Forward.h +++ b/Userland/Libraries/LibJS/Forward.h @@ -222,6 +222,7 @@ enum class DeclarationKind; struct AlreadyResolved; struct JobCallback; struct ModuleRequest; +struct ModuleWithSpecifier; // Not included in JS_ENUMERATE_NATIVE_OBJECTS due to missing distinct prototype class ProxyObject; diff --git a/Userland/Libraries/LibJS/Runtime/ModuleRequest.h b/Userland/Libraries/LibJS/Runtime/ModuleRequest.h index 98dae53d0fe..3ce814d9d25 100644 --- a/Userland/Libraries/LibJS/Runtime/ModuleRequest.h +++ b/Userland/Libraries/LibJS/Runtime/ModuleRequest.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2021-2022, David Tuin + * Copyright (c) 2023, networkException * * SPDX-License-Identifier: BSD-2-Clause */ @@ -8,9 +9,15 @@ #include #include +#include namespace JS { +struct ModuleWithSpecifier { + DeprecatedString specifier; // [[Specifier]] + NonnullGCPtr module; // [[Module]] +}; + // 2.9 ModuleRequest Records, https://tc39.es/proposal-import-assertions/#sec-modulerequest-record struct ModuleRequest { struct Assertion {