implement eval

Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
seonghyun kim 2016-12-12 14:34:31 +09:00
commit 35142d1c6a
17 changed files with 252 additions and 49 deletions

View file

@ -24,25 +24,12 @@ bool ArrayObject::setLengthSlowCase(ExecutionState& state, const Value& value)
Object::ObjectGetResult ArrayObject::getOwnProperty(ExecutionState& state, const ObjectPropertyName& P) ESCARGOT_OBJECT_SUBCLASS_MUST_REDEFINE
{
if (LIKELY(isFastModeArray())) {
uint32_t idx;
if (LIKELY(P.isUIntType())) {
idx = P.uintValue();
} else {
idx = P.string(state)->tryToUseAsArrayIndex();
}
if (LIKELY(idx != Value::InvalidArrayIndexValue)) {
ASSERT(m_fastModeData.size() == getLength(state));
if (LIKELY(idx < m_fastModeData.size())) {
Value v = m_fastModeData[idx];
if (LIKELY(!v.isEmpty())) {
return Object::ObjectGetResult(v, true, true, true);
}
return Object::ObjectGetResult();
}
}
Object::ObjectGetResult v = getFastModeValue(state, P);
if (LIKELY(v.hasValue())) {
return v;
} else {
return Object::getOwnProperty(state, P);
}
return Object::getOwnProperty(state, P);
}
bool ArrayObject::defineOwnProperty(ExecutionState& state, const ObjectPropertyName& P, const ObjectPropertyDescriptorForDefineOwnProperty& desc) ESCARGOT_OBJECT_SUBCLASS_MUST_REDEFINE