summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-04-22 19:21:02 +0100
committerLinus Groh <mail@linusgroh.de>2022-05-08 17:12:27 +0200
commitee6fb51db65d3bdde298bd097b5a39a3d6bf33d4 (patch)
tree19355de0fcda1ef10f65f038056073acc5fccb28 /Userland/Libraries
parent77ba3d3e3f6a4b6f523c0bf2047ef89bcd08d970 (diff)
downloadserenity-ee6fb51db65d3bdde298bd097b5a39a3d6bf33d4.zip
LibJS: Add a couple of missing spec steps to PerformEval
I missed these in 34f902fb524808b308efe4568ff5a026d2cb4884.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
index d360130572..c151aec699 100644
--- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
+++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp
@@ -579,9 +579,14 @@ ThrowCompletionOr<Value> perform_eval(GlobalObject& global_object, Value x, Call
return vm.throw_completion<SyntaxError>(global_object, error.to_string());
}
- auto strict_eval = strict_caller == CallerMode::Strict;
- if (program->is_strict_mode())
+ bool strict_eval = false;
+
+ // 12. If strictCaller is true, let strictEval be true.
+ if (strict_caller == CallerMode::Strict)
strict_eval = true;
+ // 13. Else, let strictEval be IsStrict of script.
+ else
+ strict_eval = program->is_strict_mode();
// 14. Let runningContext be the running execution context.
// 15. NOTE: If direct is true, runningContext will be the execution context that performed the direct eval. If direct is false, runningContext will be the execution context for the invocation of the eval function.