mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 04:08:08 +00:00
LibJS: Implement Object(value) constructor
Not sure why we didn't have this yet, it's super simple :^)
This commit is contained in:
committed by
Andreas Kling
parent
501cef2bd7
commit
2645dfafcf
@@ -66,7 +66,10 @@ ObjectConstructor::~ObjectConstructor()
|
||||
|
||||
Value ObjectConstructor::call()
|
||||
{
|
||||
return Object::create_empty(global_object());
|
||||
auto value = vm().argument(0);
|
||||
if (value.is_nullish())
|
||||
return Object::create_empty(global_object());
|
||||
return value.to_object(global_object());
|
||||
}
|
||||
|
||||
Value ObjectConstructor::construct(Function&)
|
||||
|
||||
Reference in New Issue
Block a user