mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
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.
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 08:39:39 +09:00
Author: https://github.com/davidot Commit: https://github.com/SerenityOS/serenity/commit/a394aa58309 Pull-request: https://github.com/SerenityOS/serenity/pull/8667 Reviewed-by: https://github.com/IdanHo Reviewed-by: https://github.com/linusg
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user