diff options
author | davidot <david.tuin@gmail.com> | 2021-07-12 01:33:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-20 23:45:28 +0200 |
commit | a394aa583092c2d8a7a12a252bd2d18ee65eee74 (patch) | |
tree | 09d6d253c7c8417d4b795abd6116271b172f1c6a /Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp | |
parent | a6263150be9b2719105dd9b4df3fedc2dca3d9a4 (diff) | |
download | serenity-a394aa583092c2d8a7a12a252bd2d18ee65eee74.zip |
LibJS: Fix that vm.in_strict_mode was propagated to eval and functions
For eval it depends on the CallerMode and for a created function it
depends on the function itself.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp index fea531feb3..5775335d9b 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp @@ -399,6 +399,7 @@ Value perform_eval(Value x, GlobalObject& caller_realm, CallerMode strict_caller return interpreter.execute_statement(caller_realm, program).value_or(js_undefined()); TemporaryChange scope_change(vm.running_execution_context().lexical_environment, static_cast<Environment*>(&caller_realm.environment())); + TemporaryChange scope_change_strict(vm.running_execution_context().is_strict_mode, strict_caller == CallerMode::Strict); return interpreter.execute_statement(caller_realm, program).value_or(js_undefined()); } |