mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
LibJS: VERIFY() that to_object() succeeds in Object.prototype.toString()
As null and undefined are already handled separately, this must not fail.
This commit is contained in:
parent
4794e6b0da
commit
1253a3d038
1 changed files with 1 additions and 2 deletions
|
@ -64,8 +64,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectPrototype::to_string)
|
||||||
return js_string(vm, "[object Null]");
|
return js_string(vm, "[object Null]");
|
||||||
|
|
||||||
auto* this_object = this_value.to_object(global_object);
|
auto* this_object = this_value.to_object(global_object);
|
||||||
if (!this_object)
|
VERIFY(this_object);
|
||||||
return {};
|
|
||||||
|
|
||||||
String tag;
|
String tag;
|
||||||
auto to_string_tag = this_object->get(vm.well_known_symbol_to_string_tag());
|
auto to_string_tag = this_object->get(vm.well_known_symbol_to_string_tag());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue