Ignore:
Timestamp:
Aug 30, 2017, 2:51:45 AM (8 years ago)
Author:
[email protected]
Message:

[ESNext] Async iteration - Implement async iteration statement: for-await-of
https://bugs.webkit.org/show_bug.cgi?id=166698

Reviewed by Yusuke Suzuki.

JSTests:

  • stress/async-iteration-for-await-of-syntax.js: Added.

(assert):
(checkSyntax):
(checkSyntaxError):
(checkSimpleAsyncGeneratorSloppyMode):
(checkSimpleAsyncGeneratorStrictMode):
(checkNestedAsyncGenerators):
(checkSimpleAsyncGeneratorSyntaxErrorInStrictMode):

  • stress/async-iteration-for-await-of.js: Added.

(assert):
(async.foo):
(async.boo):
(const.boo.async):

Source/JavaScriptCore:

Implementation of the for-await-of statement.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::emitIteratorNext):

  • bytecompiler/BytecodeGenerator.h:
  • parser/ASTBuilder.h:

(JSC::ASTBuilder::createForOfLoop):

  • parser/NodeConstructors.h:

(JSC::ForOfNode::ForOfNode):

  • parser/Nodes.h:

(JSC::ForOfNode::isForAwait const):

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parseForStatement):

  • parser/Parser.h:

(JSC::Scope::setSourceParseMode):
(JSC::Scope::setIsFunction):
(JSC::Scope::setIsAsyncGeneratorFunction):
(JSC::Scope::setIsAsyncGeneratorFunctionBody):

  • parser/SyntaxChecker.h:

(JSC::SyntaxChecker::createForOfLoop):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/SyntaxChecker.h

    r219443 r221358  
    247247    int createForLoop(const JSTokenLocation&, int, int, int, int, int, int, VariableEnvironment&) { return StatementResult; }
    248248    int createForInLoop(const JSTokenLocation&, int, int, int, const JSTokenLocation&, int, int, int, int, int, VariableEnvironment&) { return StatementResult; }
    249     int createForOfLoop(const JSTokenLocation&, int, int, int, const JSTokenLocation&, int, int, int, int, int, VariableEnvironment&) { return StatementResult; }
     249    int createForOfLoop(bool, const JSTokenLocation&, int, int, int, const JSTokenLocation&, int, int, int, int, int, VariableEnvironment&) { return StatementResult; }
    250250    int createEmptyStatement(const JSTokenLocation&) { return StatementResult; }
    251251    int createDeclarationStatement(const JSTokenLocation&, int, int, int) { return StatementResult; }
Note: See TracChangeset for help on using the changeset viewer.