[Pkg-javascript-commits] [uglifyjs] 173/190: Keep master in sync with harmony

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:24 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 85fbf86d7b6517161004c4f7dbfd15df4c282e3e
Author: Anthony Van de Gejuchte <anthonyvdgent at gmail.com>
Date:   Mon Jun 20 14:18:47 2016 +0200

    Keep master in sync with harmony
    
     * Do not mangle when no mangle is required
     * Improve use_asm reset while printing code
---
 lib/output.js            | 6 +++---
 test/mocha/directives.js | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/output.js b/lib/output.js
index 10465e2..5db1356 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -404,7 +404,7 @@ function OutputStream(options) {
 
     AST_Node.DEFMETHOD("print", function(stream, force_parens){
         var self = this, generator = self._codegen, prev_use_asm = use_asm;
-        if (self instanceof AST_Directive && self.value == "use asm") {
+        if (self instanceof AST_Directive && self.value == "use asm" && stream.parent() instanceof AST_Scope) {
             use_asm = true;
         }
         function doit() {
@@ -419,7 +419,7 @@ function OutputStream(options) {
             doit();
         }
         stream.pop_node();
-        if (self instanceof AST_Lambda) {
+        if (self instanceof AST_Scope) {
             use_asm = prev_use_asm;
         }
     });
@@ -1221,7 +1221,7 @@ function OutputStream(options) {
         output.print_string(self.getValue(), self.quote, in_directive);
     });
     DEFPRINT(AST_Number, function(self, output){
-        if (use_asm && self.start.raw != null) {
+        if (use_asm && self.start && self.start.raw != null) {
             output.print(self.start.raw);
         } else {
             output.print(make_num(self.getValue()));
diff --git a/test/mocha/directives.js b/test/mocha/directives.js
index 45f454b..8259475 100644
--- a/test/mocha/directives.js
+++ b/test/mocha/directives.js
@@ -224,7 +224,7 @@ describe("Directives", function() {
 
         for (var i = 0; i < tests.length; i++) {
             assert.strictEqual(
-                uglify.minify(tests[i][0], {fromString: true, quote_style: 3, compress: false}).code,
+                uglify.minify(tests[i][0], {fromString: true, quote_style: 3, compress: false, mangle: false}).code,
                 tests[i][1],
                 tests[i][0]
             );

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