[Pkg-javascript-commits] [node-acorn-jsx] 212/484: Added SpreadElement support. testFail message fixes for object methods.
Bastien Roucariès
rouca at moszumanska.debian.org
Sat Aug 19 14:20:30 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-acorn-jsx.
commit eadda16c4240d2cb93a530f07ac74caf7ff79e86
Author: Ingvar Stepanyan <me at rreverser.com>
Date: Thu Jul 24 14:33:59 2014 +0300
Added SpreadElement support.
testFail message fixes for object methods.
---
acorn.js | 12 ++++++++++++
test/tests-harmony.js | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/acorn.js b/acorn.js
index 7de20be..da572a8 100644
--- a/acorn.js
+++ b/acorn.js
@@ -1734,6 +1734,9 @@
case _new:
return parseNew();
+ case _ellipsis:
+ return parseSpread();
+
default:
unexpected();
}
@@ -1752,6 +1755,15 @@
return finishNode(node, "NewExpression");
}
+ // Parse spread element '...expr'
+
+ function parseSpread() {
+ var node = startNode();
+ next();
+ node.argument = parseExpression(true);
+ return finishNode(node, "SpreadElement");
+ }
+
// Parse an object literal.
function parseObj() {
diff --git a/test/tests-harmony.js b/test/tests-harmony.js
index cbab6dc..cc9e13d 100644
--- a/test/tests-harmony.js
+++ b/test/tests-harmony.js
@@ -15773,9 +15773,9 @@ testFail("x \n isnt y", "Unexpected token (2:7)", {ecmaVersion: 6});
testFail("function default() {}", "Unexpected token (1:9)", {ecmaVersion: 6});
-testFail("function hello() {'use strict'; ({ i: 10, s(eval) { } }); }", "Unexpected token (1:45)", {ecmaVersion: 6});
+testFail("function hello() {'use strict'; ({ i: 10, s(eval) { } }); }", "Defining 'eval' in strict mode (1:44)", {ecmaVersion: 6});
-testFail("function a() { \"use strict\"; ({ b(t, t) { } }); }", "Unexpected token (1:38)", {ecmaVersion: 6});
+testFail("function a() { \"use strict\"; ({ b(t, t) { } }); }", "Argument name clash in strict mode (1:37)", {ecmaVersion: 6});
testFail("var super", "Unexpected token (1:5)", {ecmaVersion: 6});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-acorn-jsx.git
More information about the Pkg-javascript-commits
mailing list