[Pkg-javascript-commits] [uglifyjs] 09/190: Fix semicolon printing when restricting max line length

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:07 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 170e8b519e64463a39d293480e52f97b64d8ab89
Author: Richard van Velzen <rvanvelzen at experty.com>
Date:   Wed Jul 29 17:57:18 2015 +0200

    Fix semicolon printing when restricting max line length
    
    Fixes #755
---
 lib/output.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/output.js b/lib/output.js
index 1d67b1b..44d5df6 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -161,6 +161,8 @@ function OutputStream(options) {
         str = String(str);
         var ch = str.charAt(0);
         if (might_need_semicolon) {
+            might_need_semicolon = false;
+
             if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) {
                 if (options.semicolons || requireSemicolonChars(ch)) {
                     OUTPUT += ";";
@@ -171,11 +173,14 @@ function OutputStream(options) {
                     current_pos++;
                     current_line++;
                     current_col = 0;
+
+                    // reset the semicolon flag, since we didn't print one now and
+                    // might still have to later
+                    might_need_semicolon = true;
                 }
                 if (!options.beautify)
                     might_need_space = false;
             }
-            might_need_semicolon = false;
         }
 
         if (!options.beautify && options.preserve_line && stack[stack.length - 1]) {

-- 
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