mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02: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:
committed by
Andreas Kling
parent
d74ad81402
commit
9fab52a390
Notes:
sideshowbarker
2024-07-19 07:36:36 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/9fab52a3902 Pull-request: https://github.com/SerenityOS/serenity/pull/1793
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user