mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-19 07:49:05 +00:00
LibJS: Stop coercing this to object in Function's Symbol.hasInstance
This commit is contained in:
parent
6ef56f79bd
commit
e37f96ccfe
Notes:
sideshowbarker
2024-07-18 11:10:56 +09:00
Author: https://github.com/IdanHo
Commit: e37f96ccfe
Pull-request: https://github.com/SerenityOS/serenity/pull/8346
1 changed files with 1 additions and 8 deletions
|
@ -162,14 +162,7 @@ JS_DEFINE_NATIVE_FUNCTION(FunctionPrototype::to_string)
|
|||
// 20.2.3.6 Function.prototype [ @@hasInstance ] ( V ), https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance
|
||||
JS_DEFINE_NATIVE_FUNCTION(FunctionPrototype::symbol_has_instance)
|
||||
{
|
||||
auto* this_object = vm.this_value(global_object).to_object(global_object);
|
||||
if (!this_object)
|
||||
return {};
|
||||
if (!this_object->is_function()) {
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::NotA, "Function");
|
||||
return {};
|
||||
}
|
||||
return ordinary_has_instance(global_object, vm.argument(0), this_object);
|
||||
return ordinary_has_instance(global_object, vm.argument(0), vm.this_value(global_object));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue