1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

LibJS: Support @@toPrimitive in ToPrimitive abstract operation

Fixes #3961.
This commit is contained in:
Linus Groh 2021-03-02 19:22:36 +01:00 committed by Andreas Kling
parent f99644e75b
commit 585123127e
5 changed files with 73 additions and 19 deletions

View file

@ -57,7 +57,7 @@ BigIntConstructor::~BigIntConstructor()
Value BigIntConstructor::call()
{
auto primitive = vm().argument(0).to_primitive(Value::PreferredType::Number);
auto primitive = vm().argument(0).to_primitive(global_object(), Value::PreferredType::Number);
if (vm().exception())
return {};
if (primitive.is_number()) {