DescriptionAdd parser support for generators.
This patchset begins by adding support for "yield", which is unlike other tokens
in JS. In a generator, whether strict or classic, it is a syntactic keyword.
In classic mode it is an identifier. In strict mode it is reserved.
This patch adds YIELD as a token to the scanner, and adapts the preparser and
parser appropriately. It also parses "function*", indicating that a function is
actually a generator, for both eagerly and lazily parsed functions.
Currently "yield" just compiles as "return".
BUG=v8:2355
TEST=mjsunit/harmony/generators-parsing
Committed: http://code.google.com/p/v8/source/detail?r=14116
Patch Set 1 #
Total comments: 1
Patch Set 2 : #Patch Set 3 : Fix missed case in PreParser::peek_any_identifier. #Patch Set 4 : Finish parser, build AST, add tests #
Total comments: 13
Patch Set 5 : is_generator() in Parser::FunctionState; more tests; other fixes #
Total comments: 4
Patch Set 6 : Preparser respects --harmony-generators #Patch Set 7 : Fix bad initialization list in last preparser commit #
Total comments: 2
Messages
Total messages: 13 (0 generated)
|