diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp index c31d39e7ab..b65e38a1b9 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp @@ -385,7 +385,12 @@ ThrowCompletionOr get_prototype_from_constructor(VM& vm, FunctionObject // 9.1.2.2 NewDeclarativeEnvironment ( E ), https://tc39.es/ecma262/#sec-newdeclarativeenvironment DeclarativeEnvironment* new_declarative_environment(Environment& environment) { - return environment.heap().allocate_without_realm(&environment); + auto& heap = environment.heap(); + + // 1. Let env be a new Declarative Environment Record containing no bindings. + // 2. Set env.[[OuterEnv]] to E. + // 3. Return env. + return heap.allocate_without_realm(&environment); } // 9.1.2.3 NewObjectEnvironment ( O, W, E ), https://tc39.es/ecma262/#sec-newobjectenvironment