1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

LibJS: Remove shift, pop, push functions from Array object

This abstraction isn't really that useful, as we can access the
underlying Vector<Value> using elements() and operate on it directly.
This commit is contained in:
Linus Groh 2020-04-13 16:21:54 +01:00 committed by Andreas Kling
parent d74ad81402
commit 9fab52a390
6 changed files with 18 additions and 40 deletions

View file

@ -70,11 +70,11 @@ Value ObjectConstructor::get_own_property_names(Interpreter& interpreter)
auto* result = interpreter.heap().allocate<Array>();
for (size_t i = 0; i < object->elements().size(); ++i) {
if (!object->elements()[i].is_empty())
result->push(js_string(interpreter, String::number(i)));
result->elements().append(js_string(interpreter, String::number(i)));
}
for (auto& it : object->shape().property_table())
result->push(js_string(interpreter, it.key));
result->elements().append(js_string(interpreter, it.key));
return result;
}