mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibJS: Pass prototype to BooleanObject constructor
This commit is contained in:
parent
298c606200
commit
2a15323029
5 changed files with 15 additions and 8 deletions
|
@ -119,7 +119,7 @@ Object* Value::to_object(Heap& heap) const
|
|||
return NumberObject::create(heap.interpreter().global_object(), m_value.as_double);
|
||||
|
||||
if (is_boolean())
|
||||
return heap.allocate<BooleanObject>(m_value.as_bool);
|
||||
return BooleanObject::create(heap.interpreter().global_object(), m_value.as_bool);
|
||||
|
||||
if (is_null() || is_undefined()) {
|
||||
heap.interpreter().throw_exception<TypeError>("ToObject on null or undefined.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue