mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
LibJS: Allow null or undefined as a bound |this| value in strict mode
This commit is contained in:
parent
870bcaeef6
commit
b0932b0aec
Notes:
sideshowbarker
2024-07-19 05:52:28 +09:00
Author: https://github.com/jack-karamanian
Commit: b0932b0aec
Pull-request: https://github.com/SerenityOS/serenity/pull/2487
2 changed files with 12 additions and 9 deletions
|
@ -57,7 +57,8 @@ BoundFunction* Function::bind(Value bound_this_value, Vector<Value> arguments)
|
|||
switch (bound_this_value.type()) {
|
||||
case Value::Type::Undefined:
|
||||
case Value::Type::Null:
|
||||
// FIXME: Null or undefined should be passed through in strict mode.
|
||||
if (interpreter().in_strict_mode())
|
||||
return bound_this_value;
|
||||
return &interpreter().global_object();
|
||||
default:
|
||||
return bound_this_value.to_object(interpreter());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue