v8/test/cctest
marja@chromium.org e5991fc373 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 leaves, or a single VariableProxy if there is only one
parameter. When the arrow token "=>" is found, the VariableProxy nodes are
passed to ParseArrowFunctionLiteral(), which will then skip parsing the
paramaeter list. This avoids having to rewind when the arrow is found and
restart parsing the parameter list.

Note that the empty parameter list "()" is handled directly in
ParsePrimaryExpression(): after is has consumed the opening parenthesis,
if a closing parenthesis follows, then the only valid input is an arrow
function. In this case, ParsePrimaryExpression() directly calls
ParseArrowFunctionLiteral(), to avoid needing to return a sentinel value
to signal the empty parameter list. Because it will consume the body of
the arrow function, ParseAssignmentExpression() will not see the arrow
"=>" token as next, and return the already-parser expression.

The implementation is done in ParserBase, so it was needed to do some
additions to ParserBase, ParserTraits and PreParserTraits. Some of the
glue code can be removed later on when more more functionality is moved
to ParserBase.

Additionally, this adds a runtime flag "harmony_arrow_functions"
(disabled by default); enabling "harmony" will enable it as well.

BUG=v8:2700
LOG=N
R=marja@chromium.org

Review URL: https://codereview.chromium.org/385553003

Patch from Adrián Pérez de Castro <aperez@igalia.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22320 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-07-10 12:27:07 +00:00
..
cctest.cc Buildfix for windows after r22180 2014-07-03 07:57:29 +00:00
cctest.gyp Add mips64 port. 2014-07-09 11:08:26 +00:00
cctest.h Only create arguments-maps in the bootstrapper, remove now obsolete ValueType flag. 2014-07-07 13:27:37 +00:00
cctest.status Add mips64 port. 2014-07-09 11:08:26 +00:00
DEPS Add DEPS files and run checkdeps in presubmit check 2014-06-03 13:39:42 +00:00
gay-fixed.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
gay-fixed.h Dtoa for fixed notation. 2010-05-05 13:51:27 +00:00
gay-precision.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
gay-precision.h Added precision mode to fast-dtoa. 2010-09-20 09:18:00 +00:00
gay-shortest.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
gay-shortest.h Dtoa for fixed notation. 2010-05-05 13:51:27 +00:00
log-eq-of-logging-and-traversal.js Fix test-log/EquivalenceOfLoggingAndTraversal 2013-08-26 14:56:23 +00:00
OWNERS Add per-file OWNERS for MIPS-specific cctests 2014-02-04 09:53:26 +00:00
print-extension.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
print-extension.h Use full include paths everywhere 2014-06-03 08:12:43 +00:00
profiler-extension.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
profiler-extension.h Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-accessors.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-alloc.cc Only create arguments-maps in the bootstrapper, remove now obsolete ValueType flag. 2014-07-07 13:27:37 +00:00
test-api.cc Refactor ScriptData class for cached compile data. 2014-07-10 10:28:05 +00:00
test-assembler-arm64.cc ARM64: Reland faster immediate check 2014-07-02 09:52:23 +00:00
test-assembler-arm.cc More OStreamsUse OStreams more often. 2014-07-07 09:57:29 +00:00
test-assembler-ia32.cc More OStreamsUse OStreams more often. 2014-07-07 09:57:29 +00:00
test-assembler-mips64.cc Add mips64 port. 2014-07-09 11:08:26 +00:00
test-assembler-mips.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-assembler-x64.cc More OStreamsUse OStreams more often. 2014-07-07 09:57:29 +00:00
test-assembler-x87.cc X87: More OStreamsUse OStreams more often 2014-07-08 05:24:52 +00:00
test-ast.cc New try: Parser: Delay internalizing strings and values 2014-06-24 14:03:24 +00:00
test-atomicops.cc Move atomic ops and related files to base library 2014-06-05 12:14:47 +00:00
test-bignum-dtoa.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-bignum.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-circular-queue.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-code-stubs-arm64.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-code-stubs-arm.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-code-stubs-ia32.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-code-stubs-mips64.cc Add mips64 port. 2014-07-09 11:08:26 +00:00
test-code-stubs-mips.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-code-stubs-x64.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-code-stubs-x87.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-code-stubs.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-code-stubs.h Introduce x87 port 2014-05-23 16:37:27 +00:00
test-compiler.cc Fix issues with code serializer. 2014-07-08 14:13:50 +00:00
test-condition-variable.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-constantpool.cc Add support for extended constant pool arrays. 2014-06-03 16:22:10 +00:00
test-conversions.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-cpu-ia32.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-cpu-profiler.cc Make JsNative1JsNative2JsSample cctest work on Win Release 2014-07-01 10:10:12 +00:00
test-cpu-x64.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-cpu-x87.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-cpu.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-dataflow.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-date.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-debug.cc Reland "Postpone termination exceptions in debug scope." 2014-07-08 06:57:17 +00:00
test-declarative-accessors.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-decls.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-deoptimization.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-dictionary.cc Check alpha-sorting of includes during presubmit. 2014-06-20 08:40:11 +00:00
test-disasm-arm64.cc Check alpha-sorting of includes during presubmit. 2014-06-20 08:40:11 +00:00
test-disasm-arm.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-disasm-ia32.cc More OStreamsUse OStreams more often. 2014-07-07 09:57:29 +00:00
test-disasm-mips64.cc Add mips64 port. 2014-07-09 11:08:26 +00:00
test-disasm-mips.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-disasm-x64.cc More OStreamsUse OStreams more often. 2014-07-07 09:57:29 +00:00
test-disasm-x87.cc X87: More OStreamsUse OStreams more often 2014-07-08 05:24:52 +00:00
test-diy-fp.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-double.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-dtoa.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-fast-dtoa.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-fixed-dtoa.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-flags.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-func-name-inference.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-fuzz-arm64.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-global-handles.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-global-object.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-hashing.cc Add mips64 port. 2014-07-09 11:08:26 +00:00
test-hashmap.cc Check alpha-sorting of includes during presubmit. 2014-06-20 08:40:11 +00:00
test-heap-profiler.cc Support ES6 Map and Set in heap profiler 2014-07-10 10:54:47 +00:00
test-heap.cc Add mips64 port. 2014-07-09 11:08:26 +00:00
test-hydrogen-types.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-javascript-arm64.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-js-arm64-variables.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-libplatform-default-platform.cc Add an API to pump the message loop to libplatform 2014-07-03 09:33:36 +00:00
test-libplatform-task-queue.cc Move libplatform files into v8::platform namespace 2014-07-01 08:15:09 +00:00
test-libplatform-worker-thread.cc Move libplatform files into v8::platform namespace 2014-07-01 08:15:09 +00:00
test-libplatform.h Move libplatform files into v8::platform namespace 2014-07-01 08:15:09 +00:00
test-list.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-liveedit.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-lockers.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-log-stack-tracer.cc CPU profiler: increase the max number of captured frames. 2014-06-24 16:00:51 +00:00
test-log.cc Check alpha-sorting of includes during presubmit. 2014-06-20 08:40:11 +00:00
test-macro-assembler-arm.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-macro-assembler-ia32.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-macro-assembler-mips64.cc Add mips64 port. 2014-07-09 11:08:26 +00:00
test-macro-assembler-mips.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-macro-assembler-x64.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-macro-assembler-x87.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-mark-compact.cc An object should only be promoted to the old generation if it survived a scavenge operation. 2014-06-23 08:50:54 +00:00
test-mementos.cc Remove dependency on Vector from platform files 2014-06-13 16:43:27 +00:00
test-microtask-delivery.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-mutex.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-object-observe.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-ordered-hash-table.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-ostreams.cc Unbreak Win64 build (hopefully). 2014-06-27 10:01:44 +00:00
test-parsing.cc Implement handling of arrow functions in the parser 2014-07-10 12:27:07 +00:00
test-platform-linux.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-platform-macos.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-platform-tls.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-platform-win32.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-platform.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-profile-generator.cc Remove dependency on Vector from platform files 2014-06-13 16:43:27 +00:00
test-random-number-generator.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-regexp.cc Add mips64 port. 2014-07-09 11:08:26 +00:00
test-reloc-info.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-representation.cc Check alpha-sorting of includes during presubmit. 2014-06-20 08:40:11 +00:00
test-semaphore.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-serialize.cc Refactor ScriptData class for cached compile data. 2014-07-10 10:28:05 +00:00
test-spaces.cc Disable test-spaces/SizeOfFirstPageIsLargeEnough for snapshot=off build. 2014-07-01 11:54:57 +00:00
test-strings.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-strtod.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-symbols.cc More OStreamsUse OStreams more often. 2014-07-07 09:57:29 +00:00
test-thread-termination.cc Reland "Add mechanism to postpone interrupts selectively." 2014-07-02 08:05:40 +00:00
test-threads.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-time.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-types.cc Properly seed the RNG for cctest/test-types. 2014-07-07 07:04:16 +00:00
test-unbound-queue.cc Check alpha-sorting of includes during presubmit. 2014-06-20 08:40:11 +00:00
test-unique.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-utils-arm64.cc Check alpha-sorting of includes during presubmit. 2014-06-20 08:40:11 +00:00
test-utils-arm64.h Check alpha-sorting of includes during presubmit. 2014-06-20 08:40:11 +00:00
test-utils.cc Move platform abstraction to base library 2014-06-30 13:25:46 +00:00
test-version.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-weakmaps.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-weaksets.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
test-weaktypedarrays.cc Check alpha-sorting of includes during presubmit. 2014-06-20 08:40:11 +00:00
testcfg.py Fix test serialization path for windows. 2014-03-26 07:40:32 +00:00
trace-extension.cc Use full include paths everywhere 2014-06-03 08:12:43 +00:00
trace-extension.h Use full include paths everywhere 2014-06-03 08:12:43 +00:00