mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
1. Object derived from primitive value can't define its new property
2. Fix bug with floating point precision in Date.parse 3. Fix bug in Date.setYear()/setFullyear() occured with invalid date value Signed-off-by: Saebom Kim sae-bom.kim@samsung.com
This commit is contained in:
parent
30489bbf09
commit
ab00bdfdd2
4 changed files with 57 additions and 31 deletions
|
|
@ -691,11 +691,13 @@ Value ByteCodeInterpreter::interpret(ExecutionState& state, ByteCodeBlock* byteC
|
|||
const Value& willBeObject = registerFile[code->m_objectRegisterIndex];
|
||||
const Value& property = registerFile[code->m_propertyRegisterIndex];
|
||||
Object* obj = willBeObject.toObject(state);
|
||||
if (willBeObject.isPrimitive()) {
|
||||
obj->ensureObjectRareData()->m_isExtensible = false;
|
||||
}
|
||||
|
||||
bool result = obj->setIndexedProperty(state, property, registerFile[code->m_loadRegisterIndex]);
|
||||
if (UNLIKELY(!result)) {
|
||||
if (state.inStrictMode()) {
|
||||
// copy assignee for generating right execution result
|
||||
registerFile[code->m_objectRegisterIndex] = registerFile[code->m_loadRegisterIndex];
|
||||
Object::throwCannotWriteError(state, PropertyName(state, property.toString(state)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue