[Pkg-javascript-commits] [uglifyjs] 13/77: Fix #556

Jonas Smedegaard dr at jones.dk
Tue May 19 00:02:27 UTC 2015


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

js pushed a commit to tag v2.4.18
in repository uglifyjs.

commit 24bc09b79bf9ca3a09eef4f536e7637568f7097a
Author: Richard van Velzen <rvanvelzen1 at gmail.com>
Date:   Thu Oct 23 16:16:19 2014 +0200

    Fix #556
    
    `\uFEFF` (ZERO WIDTH NO-BREAK SPACE) is removed when parsing, but was
    un-escaped for the output when `ascii_only` was false.
    
    When using
    UglifyJS multiple times (creating packages from minified sources, for
    example), this would lead to problems because the byte was removed when
    parsing for the second time.
---
 lib/output.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/output.js b/lib/output.js
index 7bca4da..72bcdd5 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -86,7 +86,7 @@ function OutputStream(options) {
 
     function make_string(str) {
         var dq = 0, sq = 0;
-        str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){
+        str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0\ufeff]/g, function(s){
             switch (s) {
               case "\\": return "\\\\";
               case "\b": return "\\b";
@@ -98,6 +98,7 @@ function OutputStream(options) {
               case '"': ++dq; return '"';
               case "'": ++sq; return "'";
               case "\0": return "\\x00";
+              case "\ufeff": return "\\ufeff";
             }
             return s;
         });

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