1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:47:44 +00:00

LibJS: Add JSON.stringify

This commit is contained in:
Matthew Olsson 2020-06-10 11:01:00 -07:00 committed by Andreas Kling
parent b4577ffcf3
commit 39576b2238
19 changed files with 678 additions and 10 deletions

View file

@ -81,10 +81,7 @@ Value ArrayConstructor::construct(Interpreter& interpreter)
Value ArrayConstructor::is_array(Interpreter& interpreter)
{
auto value = interpreter.argument(0);
if (!value.is_array())
return Value(false);
// Exclude TypedArray and similar
return Value(StringView(value.as_object().class_name()) == "Array");
return Value(value.is_array());
}
Value ArrayConstructor::of(Interpreter& interpreter)