[Pkg-javascript-commits] [node-acorn-jsx] 35/484: Require a semicolon after do/while
Bastien Roucariès
rouca at moszumanska.debian.org
Sat Aug 19 14:20:00 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 daefc220daff973038bccea7700a07cf0f6cbd70
Author: Marijn Haverbeke <marijnh at gmail.com>
Date: Wed Oct 17 23:09:15 2012 +0200
Require a semicolon after do/while
---
acorn.js | 1 +
index.html | 1 +
test/tests.js | 17 ++---------------
3 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/acorn.js b/acorn.js
index 552eee7..07c15ee 100644
--- a/acorn.js
+++ b/acorn.js
@@ -1017,6 +1017,7 @@
labels.pop();
expect(_while);
node.test = parseParenExpression();
+ semicolon();
return finishNode(node, "DoWhileStatement");
// Disambiguating between a `for` and a `for`/`in` loop is
diff --git a/index.html b/index.html
index bba0ab3..faa7fd8 100644
--- a/index.html
+++ b/index.html
@@ -699,6 +699,7 @@ continue to.</p> </td> <td class="code"> <
<span class="nx">labels</span><span class="p">.</span><span class="nx">pop</span><span class="p">();</span>
<span class="nx">expect</span><span class="p">(</span><span class="nx">_while</span><span class="p">);</span>
<span class="nx">node</span><span class="p">.</span><span class="nx">test</span> <span class="o">=</span> <span class="nx">parseParenExpression</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">"DoWhileStatement"</span><span class="p">);</span></pre></div> </td> </tr> <tr id="section-93"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-93">¶</a> </div> <p>D [...]
non-trivial. Basically, we have to parse the init <code>var</code>
statement or expression, disallowing the <code>in</code> operator (see
diff --git a/test/tests.js b/test/tests.js
index d9c4670..2b26761 100644
--- a/test/tests.js
+++ b/test/tests.js
@@ -17697,19 +17697,6 @@ test("do keep(); while (true);", {
},
end: {
line: 1,
- column: 23
- }
- }
- },
- {
- type: "EmptyStatement",
- loc: {
- start: {
- line: 1,
- column: 23
- },
- end: {
- line: 1,
column: 24
}
}
@@ -17897,7 +17884,7 @@ test("do { x++; y--; } while (x < 10)", {
}
});
-test("{ do { } while (false) false }", {
+test("{ do { } while (false);false }", {
type: "Program",
body: [
{
@@ -17940,7 +17927,7 @@ test("{ do { } while (false) false }", {
},
end: {
line: 1,
- column: 22
+ column: 23
}
}
},
--
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