mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +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
@@ -111,7 +111,7 @@ Value FunctionExpression::execute(Interpreter& interpreter, GlobalObject& global
|
||||
func_env->create_immutable_binding(global_object, name(), false);
|
||||
}
|
||||
|
||||
auto closure = OrdinaryFunctionObject::create(global_object, name(), body(), parameters(), function_length(), func_env, kind(), is_strict_mode() || interpreter.vm().in_strict_mode(), is_arrow_function());
|
||||
auto closure = OrdinaryFunctionObject::create(global_object, name(), body(), parameters(), function_length(), func_env, kind(), is_strict_mode(), is_arrow_function());
|
||||
|
||||
if (has_identifier)
|
||||
func_env->initialize_binding(global_object, name(), closure);
|
||||
|
||||
Reference in New Issue
Block a user