Implement basic of AsyncGeneratorFunction

* Add ScriptAsyncGeneratorFunctionObject, AsyncGeneatorObject
  * Implement basic behavior of AsyncGeneratorFunction

Update Script Parser
  * Reverse allowYield value.
  * Allow AsyncGenerator
  * In parameter, we should not allow yield, await expression

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
Seonghyun Kim 2020-01-23 10:27:57 +09:00 committed by Hyukwoo Park
commit f61ef74973
27 changed files with 982 additions and 682 deletions

View file

@ -44,9 +44,11 @@ ScriptFunctionObject::ScriptFunctionObject(ExecutionState& state, CodeBlock* cod
{
initStructureAndValues(state, isConstructor, isGenerator, isAsync);
if (isGenerator) {
if (UNLIKELY(isGenerator && isAsync)) {
Object::setPrototypeForIntrinsicObjectCreation(state, state.context()->globalObject()->asyncFunctionPrototype());
} else if (UNLIKELY(isGenerator)) {
Object::setPrototypeForIntrinsicObjectCreation(state, state.context()->globalObject()->generator());
} else if (isAsync) {
} else if (UNLIKELY(isAsync)) {
Object::setPrototypeForIntrinsicObjectCreation(state, state.context()->globalObject()->asyncFunctionPrototype());
} else {
Object::setPrototypeForIntrinsicObjectCreation(state, state.context()->globalObject()->functionPrototype());