mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Implement more things according to newer ECMAScript spec
* Fix parser error related with async arrow function * CodeBlock may have diffrent source code start position data(from `function` keyword) - new ECMAScript spec says we should make function source string from `function` keyword * Apply new spec on builtin Function constructor * AsyncFunctions must have correct initial properties Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
f232bba7d7
commit
ae35a576f5
25 changed files with 178 additions and 204 deletions
|
|
@ -38,14 +38,16 @@
|
|||
|
||||
namespace Escargot {
|
||||
|
||||
ScriptFunctionObject::ScriptFunctionObject(ExecutionState& state, CodeBlock* codeBlock, LexicalEnvironment* outerEnv, bool isConstructor, bool isGenerator)
|
||||
ScriptFunctionObject::ScriptFunctionObject(ExecutionState& state, CodeBlock* codeBlock, LexicalEnvironment* outerEnv, bool isConstructor, bool isGenerator, bool isAsync)
|
||||
: ScriptFunctionObject(state, codeBlock, outerEnv,
|
||||
((isConstructor || isGenerator) ? (ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER + 3) : (ESCARGOT_OBJECT_BUILTIN_PROPERTY_NUMBER + 2)) + (codeBlock->isStrict() ? 2 : 0))
|
||||
{
|
||||
initStructureAndValues(state, isConstructor, isGenerator);
|
||||
initStructureAndValues(state, isConstructor, isGenerator, isAsync);
|
||||
|
||||
if (isGenerator) {
|
||||
Object::setPrototypeForIntrinsicObjectCreation(state, state.context()->globalObject()->generator());
|
||||
} else if (isAsync) {
|
||||
Object::setPrototypeForIntrinsicObjectCreation(state, state.context()->globalObject()->asyncFunctionPrototype());
|
||||
} else {
|
||||
Object::setPrototypeForIntrinsicObjectCreation(state, state.context()->globalObject()->functionPrototype());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue