LibJS: Store Module::environment() as ModuleEnvironment

Let's use a more specific type here to allow for devirtualization.
This commit is contained in:
Andreas Kling 2025-03-16 17:41:24 -05:00 committed by Andreas Kling
parent 603df37a88
commit 8fcff2fa18
Notes: github-actions[bot] 2025-03-20 17:52:55 +00:00
6 changed files with 16 additions and 13 deletions

View file

@ -6,6 +6,7 @@
#include <AK/QuickSort.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/ModuleEnvironment.h>
#include <LibJS/Runtime/ModuleNamespaceObject.h>
namespace JS {
@ -173,7 +174,7 @@ ThrowCompletionOr<Value> ModuleNamespaceObject::internal_get(PropertyKey const&
}
// 10. Let targetEnv be targetModule.[[Environment]].
auto* target_environment = target_module->environment();
auto target_environment = target_module->environment();
// 11. If targetEnv is empty, throw a ReferenceError exception.
if (!target_environment)