Convert to non-fast-mode array when preventExtensions called (#186)

* first, convert to non-fast-mode and then, set non-extensible
* preventExtensions api is also updated

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
Hyukwoo Park 2019-04-08 19:24:55 +09:00 committed by yichoi
commit 64ea29e82b
6 changed files with 45 additions and 8 deletions

View file

@ -409,6 +409,14 @@ bool ArrayObject::setIndexedProperty(ExecutionState& state, const Value& propert
return set(state, ObjectPropertyName(state, property), value, this);
}
bool ArrayObject::preventExtensions(ExecutionState& state)
{
// first, convert to non-fast-mode.
// then, set preventExtensions
convertIntoNonFastMode(state);
return Object::preventExtensions(state);
}
ArrayIteratorObject::ArrayIteratorObject(ExecutionState& state, Object* a, Type type)
: IteratorObject(state)
, m_array(a)