mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
Implement ES6 Symbol.hasInstance, iterator, toStringTag, toPrimitive and built-ins (#46)
* Implement Array.from * Disable part of ES6-shim due to wrong implementation Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
a363289951
commit
e66f512b32
61 changed files with 1407 additions and 419 deletions
|
|
@ -25,6 +25,7 @@ namespace Escargot {
|
|||
|
||||
extern size_t g_doubleInSmallValueTag;
|
||||
extern size_t g_objectRareDataTag;
|
||||
extern size_t g_symbolTag;
|
||||
|
||||
Value VMInstance::functionPrototypeNativeGetter(ExecutionState& state, Object* self, const SmallValue& privateDataFromObjectPrivateArea)
|
||||
{
|
||||
|
|
@ -182,6 +183,13 @@ VMInstance::VMInstance(const char* locale, const char* timezone)
|
|||
ObjectRareData data(nullptr);
|
||||
g_objectRareDataTag = *((size_t*)&data);
|
||||
|
||||
Symbol sm(nullptr);
|
||||
g_symbolTag = *((size_t*)&sm);
|
||||
|
||||
#define DECLARE_GLOBAL_SYMBOLS(name) m_globalSymbols.name = new Symbol(String::fromASCII("Symbol." #name));
|
||||
DEFINE_GLOBAL_SYMBOLS(DECLARE_GLOBAL_SYMBOLS);
|
||||
#undef DECLARE_GLOBAL_SYMBOLS
|
||||
|
||||
ExecutionState stateForInit((Context*)nullptr);
|
||||
|
||||
ObjectStructure defaultStructureForObject(stateForInit);
|
||||
|
|
@ -238,6 +246,8 @@ VMInstance::VMInstance(const char* locale, const char* timezone)
|
|||
|
||||
m_defaultStructureForStringObject = m_defaultStructureForObject->addProperty(stateForInit, m_staticStrings.length, ObjectStructurePropertyDescriptor::createDataButHasNativeGetterSetterDescriptor(&stringLengthGetterSetterData));
|
||||
|
||||
m_defaultStructureForSymbolObject = m_defaultStructureForObject;
|
||||
|
||||
m_defaultStructureForRegExpObject = m_defaultStructureForObject->addProperty(stateForInit, m_staticStrings.lastIndex,
|
||||
ObjectStructurePropertyDescriptor::createDataButHasNativeGetterSetterDescriptor(®expLastIndexGetterSetterData));
|
||||
// TODO(ES6): Below RegExp data properties is changed to accessor properties of RegExp.prototype in ES6.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue