mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
1. implement instanceof, in, delete operator
2. VariableDeclaratorNode does not affect execute result 3. optimize Object get, set in interpreter Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
b2ea88b251
commit
11e625f373
26 changed files with 386 additions and 114 deletions
|
|
@ -88,17 +88,17 @@ void GlobalObject::installError(ExecutionState& state)
|
|||
m_errorPrototype->defineOwnPropertyThrowsException(state, state.context()->staticStrings().toString, ObjectPropertyDescriptor(errorToStringFn, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectPropertyDescriptor::ConfigurablePresent)));
|
||||
|
||||
// m_##name##Error->defineAccessorProperty(strings->prototype.string(), ESVMInstance::currentInstance()->functionPrototypeAccessorData(), false, false, false);
|
||||
#define DEFINE_ERROR(errorname, bname) \
|
||||
m_##errorname##Error = new FunctionObject(state, NativeFunctionInfo(state.context()->staticStrings().bname##Error, builtinErrorConstructor, 1, [](ExecutionState& state, size_t argc, Value* argv) -> Object* { \
|
||||
return new bname##ErrorObject(state, String::emptyString); \
|
||||
})); \
|
||||
m_##errorname##Error->setPrototype(state, m_functionPrototype); \
|
||||
m_##errorname##ErrorPrototype = new ErrorObject(state, String::emptyString); \
|
||||
#define DEFINE_ERROR(errorname, bname) \
|
||||
m_##errorname##Error = new FunctionObject(state, NativeFunctionInfo(state.context()->staticStrings().bname##Error, builtinErrorConstructor, 1, [](ExecutionState& state, size_t argc, Value* argv) -> Object* { \
|
||||
return new bname##ErrorObject(state, String::emptyString); \
|
||||
})); \
|
||||
m_##errorname##Error->setPrototype(state, m_functionPrototype); \
|
||||
m_##errorname##ErrorPrototype = new ErrorObject(state, String::emptyString); \
|
||||
m_##errorname##ErrorPrototype->defineOwnProperty(state, state.context()->staticStrings().constructor, ObjectPropertyDescriptor(m_##errorname##Error, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectStructurePropertyDescriptor::EnumerablePresent))); \
|
||||
m_##errorname##ErrorPrototype->defineOwnProperty(state, state.context()->staticStrings().message, ObjectPropertyDescriptor(String::emptyString, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectStructurePropertyDescriptor::EnumerablePresent))); \
|
||||
m_##errorname##ErrorPrototype->defineOwnProperty(state, state.context()->staticStrings().name, ObjectPropertyDescriptor(String::emptyString, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectStructurePropertyDescriptor::EnumerablePresent))); \
|
||||
m_##errorname##Error->setFunctionPrototype(state, m_##errorname##ErrorPrototype); \
|
||||
defineOwnProperty(state, ObjectPropertyName(state.context()->staticStrings().bname##Error), \
|
||||
m_##errorname##Error->setFunctionPrototype(state, m_##errorname##ErrorPrototype); \
|
||||
defineOwnProperty(state, ObjectPropertyName(state.context()->staticStrings().bname##Error), \
|
||||
ObjectPropertyDescriptor(m_function, (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectStructurePropertyDescriptor::EnumerablePresent)));
|
||||
|
||||
DEFINE_ERROR(reference, Reference);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue