1
Fork 0
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:
Andreas Kling 2020-04-17 19:03:52 +02:00
parent 298c606200
commit 2a15323029
5 changed files with 15 additions and 8 deletions

View file

@ -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.");