mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibJS: Use caller_context to determine strict mode
This is functionaly the same since caller_context is the topmost execution context on the stack, but makes it more clear that we are directly inheriting the strict mode from the caller context when pushing the next context on to the stack.
This commit is contained in:
parent
7d44640c0f
commit
3bf7f94150
|
|
@ -151,7 +151,7 @@ ThrowCompletionOr<Value> NativeFunction::internal_call(ExecutionContext& callee_
|
|||
callee_context.private_environment = caller_context.private_environment;
|
||||
|
||||
// NOTE: This is a LibJS specific hack for NativeFunction to inherit the strictness of its caller.
|
||||
callee_context.is_strict_mode = vm.in_strict_mode();
|
||||
callee_context.is_strict_mode = caller_context.is_strict_mode;
|
||||
|
||||
// </8.> --------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -210,7 +210,7 @@ ThrowCompletionOr<GC::Ref<Object>> NativeFunction::internal_construct(ReadonlySp
|
|||
callee_context->variable_environment = caller_context.variable_environment;
|
||||
|
||||
// NOTE: This is a LibJS specific hack for NativeFunction to inherit the strictness of its caller.
|
||||
callee_context->is_strict_mode = vm.in_strict_mode();
|
||||
callee_context->is_strict_mode = caller_context.is_strict_mode;
|
||||
|
||||
// </8.> --------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user