mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +00:00
LibJS: Remove hand-rolled Object is_foo() helpers in favor of RTTI
This commit is contained in:
parent
8333055c3d
commit
f48751a739
47 changed files with 78 additions and 107 deletions
|
@ -132,7 +132,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::construct)
|
|||
if (vm.argument_count() > 2) {
|
||||
auto new_target_value = vm.argument(2);
|
||||
if (!new_target_value.is_function()
|
||||
|| (new_target_value.as_object().is_native_function() && !static_cast<NativeFunction&>(new_target_value.as_object()).has_constructor())) {
|
||||
|| (is<NativeFunction>(new_target_value.as_object()) && !static_cast<NativeFunction&>(new_target_value.as_object()).has_constructor())) {
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::ReflectBadNewTarget);
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue