Reviewers: Igor Sheludko, mathiasb, jochen, Michael Starzinger, rossberg,
Description:
Implement handling of arrow functions in the parser
Arrow functions are parsed from ParseAssignmentExpression. Handling the
parameter list is done by letting ParseConditionalExpression parse
a comma-separated list of identifiers, and it returns a tree of
BinaryOperation nodes with VariableProxy nodes as its leaves, or a single
VariableProxy if there is only one parameter. When the arrow token "=>" is
found, the VariableProxy nodes are pased to ParseArrowFunctionBody. This
needs a special case for handling the empty list "()" as ParseExpression
expects parenthesized expressions to not be empty. In this last case,
ParseExpression will return NULL, meaning that the parameter list for
the arrow function is empty.
LOG=Y
BUG=v8:2700
TEST=mjsunit/harmony/arrow-functions-parsing
Please review this at https://codereview.chromium.org/160073006/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+302, -6 lines):
M src/ast.h
M src/flag-definitions.h
M src/messages.js
M src/parser.h
M src/parser.cc
M src/preparser.h
M src/preparser.cc
M src/prettyprinter.cc
M src/scanner.cc
M src/scopes.h
M src/token.h
A test/mjsunit/harmony/arrow-functions-parsing.js
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.