From 01c2ecf355868f7c8d3d757488e7d20b039fcc61 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sat, 2 Nov 2024 18:51:53 +1300 Subject: [PATCH] LibJS: Update comments for WrappedFunction [[Call]] implementation --- Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp b/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp index 0b04092bd55..95ea71c6f06 100644 --- a/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp @@ -68,16 +68,13 @@ ThrowCompletionOr WrappedFunction::internal_call(Value this_argument, Rea // 3. Assert: calleeContext is now the running execution context. VERIFY(&vm.running_execution_context() == callee_context); - // 4. Let result be OrdinaryWrappedFunctionCall(F, thisArgument, argumentsList). + // 4. Let result be Completion(OrdinaryWrappedFunctionCall(F, thisArgument, argumentsList)). auto result = ordinary_wrapped_function_call(*this, this_argument, arguments_list); // 5. Remove calleeContext from the execution context stack and restore callerContext as the running execution context. vm.pop_execution_context(); - // NOTE: I think the spec isn't fully correct here, see https://github.com/tc39/proposal-shadowrealm/issues/371. - // 6. If result.[[Type]] is return, return result.[[Value]]. - // 7. ReturnIfAbrupt(result). - // 8. Return undefined. + // 6. Return ? result. return result; }