mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
LibJS: Handle empty values in Array.prototype.toString()
This commit is contained in:
parent
5c90cfa90f
commit
531335f57c
2 changed files with 8 additions and 1 deletions
|
@ -100,7 +100,8 @@ Value ArrayPrototype::to_string(Interpreter& interpreter)
|
|||
for (size_t i = 0; i < array->elements().size(); ++i) {
|
||||
if (i != 0)
|
||||
builder.append(',');
|
||||
builder.append(array->elements()[i].to_string());
|
||||
if (!array->elements()[i].is_empty())
|
||||
builder.append(array->elements()[i].to_string());
|
||||
}
|
||||
return js_string(interpreter, builder.to_string());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue