mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
1. implement ObjectDefineOwnPropertyOperation
2. Add errorcode in ScriptError 3. Fix array length bug 4. Fix ObjectPropertyDescriptor::ObjectPropertyDescriptor(ExecutionState& state, Object* obj) Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
c024ad87f9
commit
5bca24da82
18 changed files with 244 additions and 125 deletions
|
|
@ -553,11 +553,22 @@ void ByteCodeInterpreter::interpret(ExecutionState& state, CodeBlock* codeBlock,
|
|||
|
||||
CreateArrayOpcodeLbl : {
|
||||
CreateArray* code = (CreateArray*)currentCode;
|
||||
registerFile[code->m_registerIndex] = new ArrayObject(state);
|
||||
ArrayObject* arr = new ArrayObject(state);
|
||||
arr->setLength(state, code->m_length);
|
||||
registerFile[code->m_registerIndex] = arr;
|
||||
ADD_PROGRAM_COUNTER(CreateArray);
|
||||
NEXT_INSTRUCTION();
|
||||
}
|
||||
|
||||
ObjectDefineOwnPropertyOperationOpcodeLbl : {
|
||||
ObjectDefineOwnPropertyOperation* code = (ObjectDefineOwnPropertyOperation*)currentCode;
|
||||
const Value& willBeObject = registerFile[code->m_objectRegisterIndex];
|
||||
const Value& property = registerFile[code->m_propertyRegisterIndex];
|
||||
willBeObject.asObject()->defineOwnProperty(state, ObjectPropertyName(state, property), ObjectPropertyDescriptor(registerFile[code->m_loadRegisterIndex], ObjectPropertyDescriptor::AllPresent));
|
||||
ADD_PROGRAM_COUNTER(ObjectDefineOwnPropertyOperation);
|
||||
NEXT_INSTRUCTION();
|
||||
}
|
||||
|
||||
DeclareVarVariableOpcodeLbl : {
|
||||
DeclareVarVariable* code = (DeclareVarVariable*)currentCode;
|
||||
record->createMutableBinding(state, code->m_name, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue