[Pkg-javascript-commits] [uglifyjs] 74/190: Semicolon after do...while statement is optional

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.

commit bd99b004137961b3b604fcd55602835bf6ffc522
Author: Anthony Van de Gejuchte <anthonyvdgent at gmail.com>
Date:   Thu Dec 17 23:02:35 2015 +0100

    Semicolon after do...while statement is optional
---
 lib/parse.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/parse.js b/lib/parse.js
index de27d98..4d06ae0 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -724,9 +724,9 @@ function parse($TEXT, options) {
         );
     };
 
-    function semicolon() {
+    function semicolon(optional) {
         if (is("punc", ";")) next();
-        else if (!can_insert_semicolon()) unexpected();
+        else if (!optional && !can_insert_semicolon()) unexpected();
     };
 
     function parenthesised() {
@@ -814,7 +814,7 @@ function parse($TEXT, options) {
               case "do":
                 return new AST_Do({
                     body      : in_loop(statement),
-                    condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(), tmp)
+                    condition : (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(true), tmp)
                 });
 
               case "while":

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list