mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Implement spread operator (#168)
Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
parent
19c6721d2f
commit
ae28733902
16 changed files with 396 additions and 23 deletions
|
|
@ -28,14 +28,14 @@ namespace Escargot {
|
|||
|
||||
size_t g_arrayObjectTag;
|
||||
|
||||
ArrayObject::ArrayObject(ExecutionState& state)
|
||||
ArrayObject::ArrayObject(ExecutionState& state, bool hasSpreadElement)
|
||||
: Object(state, ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER + 1, true)
|
||||
{
|
||||
m_structure = state.context()->defaultStructureForArrayObject();
|
||||
m_values[ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER] = Value(0);
|
||||
Object::setPrototype(state, state.context()->globalObject()->arrayPrototype());
|
||||
|
||||
if (UNLIKELY(state.context()->vmInstance()->didSomePrototypeObjectDefineIndexedProperty())) {
|
||||
if (UNLIKELY(state.context()->vmInstance()->didSomePrototypeObjectDefineIndexedProperty() || hasSpreadElement)) {
|
||||
ensureObjectRareData()->m_isFastModeArrayObject = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue