[Pkg-javascript-commits] [node-acorn-jsx] 58/484: Add missing semicolon() calls to debugger and throw statement parsers
Bastien Roucariès
rouca at moszumanska.debian.org
Sat Aug 19 14:20:05 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 5771c8b4b256018666278e1084e876aaef5efde7
Author: Marijn Haverbeke <marijnh at gmail.com>
Date: Thu Nov 22 09:48:01 2012 +0100
Add missing semicolon() calls to debugger and throw statement parsers
Issue #5
---
acorn.js | 2 ++
index.html | 2 ++
test/tests.js | 26 --------------------------
3 files changed, 4 insertions(+), 26 deletions(-)
diff --git a/acorn.js b/acorn.js
index 9160e58..7785748 100644
--- a/acorn.js
+++ b/acorn.js
@@ -1067,6 +1067,7 @@
case _debugger:
next();
+ semicolon();
return finishNode(node, "DebuggerStatement");
case _do:
@@ -1166,6 +1167,7 @@
if (newline.test(input.slice(lastEnd, tokStart)))
raise(lastEnd, "Illegal newline after throw");
node.argument = parseExpression();
+ semicolon();
return finishNode(node, "ThrowStatement");
case _try:
diff --git a/index.html b/index.html
index 8a4419b..625d5a6 100644
--- a/index.html
+++ b/index.html
@@ -750,6 +750,7 @@ continue to.</p> </td> <td class="code"> <
<span class="k">case</span> <span class="nx">_debugger</span><span class="o">:</span>
<span class="nx">next</span><span class="p">();</span>
+ <span class="nx">semicolon</span><span class="p">();</span>
<span class="k">return</span> <span class="nx">finishNode</span><span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="s2">"DebuggerStatement"</span><span class="p">);</span>
<span class="k">case</span> <span class="nx">_do</span><span class="o">:</span>
@@ -839,6 +840,7 @@ adding statements to.</p> </td> <td class="code">
<span class="k">if</span> <span class="p">(</span><span class="nx">newline</span><span class="p">.</span><span class="nx">test</span><span class="p">(</span><span class="nx">input</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="nx">lastEnd</span><span class="p">,</span> <span class="nx">tokStart</span><span class="p">)))</span>
<span class="nx">raise</span><span class="p">(</span><span class="nx">lastEnd</span><span class="p">,</span> <span class="s2">"Illegal newline after throw"</span><span class="p">);</span>
<span class="nx">node</span><span class="p">.</span><span class="nx">argument</span> <span class="o">=</span> <span class="nx">parseExpression</span><span class="p">();</span>
+ <span class="nx">semicolon</span><span class="p">();</span>
<span class="k">return</span> <span class="nx">finishNode</span><span class="p">(</span><span class="nx">node</span><span class="p">,</span> <span class="s2">"ThrowStatement"</span><span class="p">);</span>
<span class="k">case</span> <span class="nx">_try</span><span class="o">:</span>
diff --git a/test/tests.js b/test/tests.js
index 50852d5..e571d49 100644
--- a/test/tests.js
+++ b/test/tests.js
@@ -21636,19 +21636,6 @@ test("throw x;", {
},
end: {
line: 1,
- column: 7
- }
- }
- },
- {
- type: "EmptyStatement",
- loc: {
- start: {
- line: 1,
- column: 7
- },
- end: {
- line: 1,
column: 8
}
}
@@ -22792,19 +22779,6 @@ test("debugger;", {
},
end: {
line: 1,
- column: 8
- }
- }
- },
- {
- type: "EmptyStatement",
- loc: {
- start: {
- line: 1,
- column: 8
- },
- end: {
- line: 1,
column: 9
}
}
--
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