mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +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:
committed by
Andreas Kling
parent
d74ad81402
commit
9fab52a390
@@ -41,25 +41,6 @@ Array::~Array()
|
||||
{
|
||||
}
|
||||
|
||||
Value Array::shift()
|
||||
{
|
||||
if (elements().size() == 0)
|
||||
return js_undefined();
|
||||
return Value(elements().take_first());
|
||||
}
|
||||
|
||||
Value Array::pop()
|
||||
{
|
||||
if (elements().size() == 0)
|
||||
return js_undefined();
|
||||
return Value(elements().take_last());
|
||||
}
|
||||
|
||||
void Array::push(Value value)
|
||||
{
|
||||
elements().append(value);
|
||||
}
|
||||
|
||||
Value Array::length_getter(Interpreter& interpreter)
|
||||
{
|
||||
auto* this_object = interpreter.this_value().to_object(interpreter.heap());
|
||||
|
||||
Reference in New Issue
Block a user