mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
1. When 'writable' property of array length turned into 'false', convert it into NonFastMode
2. If RegExp's source needs escapeSlash process, it should count the number of leading backSlashs Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
This commit is contained in:
parent
74805fddd8
commit
6d4ed41488
5 changed files with 107 additions and 410 deletions
|
|
@ -246,8 +246,13 @@ bool ArrayObject::setArrayLength(ExecutionState& state, const uint64_t& newLengt
|
|||
|
||||
if (LIKELY(isFastModeArray())) {
|
||||
auto oldSize = getArrayLength(state);
|
||||
auto oldLenDesc = structure()->readProperty(state, (size_t)0);
|
||||
m_values[ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER] = Value(newLength);
|
||||
m_fastModeData.resize(oldSize, newLength, Value(Value::EmptyValue));
|
||||
|
||||
if (UNLIKELY(!oldLenDesc.m_descriptor.isWritable())) {
|
||||
convertIntoNonFastMode(state);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
if (!isInArrayObjectDefineOwnProperty()) {
|
||||
|
|
@ -278,10 +283,6 @@ bool ArrayObject::setArrayLength(ExecutionState& state, const uint64_t& newLengt
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!oldLenDesc.m_descriptor.isWritable()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
m_values[ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER] = Value(newLength);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue