[Pkg-javascript-commits] [uglifyjs] 186/491: enhance source mapping on IIFEs (#2224)

Jonas Smedegaard dr at jones.dk
Wed Feb 14 19:51:34 UTC 2018


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

js pushed a commit to annotated tag debian/3.3.10-1
in repository uglifyjs.

commit 10a938cb79d19e1476e2744c8651011fd4d7b902
Author: Alex Lam S.L <alexlamsl at gmail.com>
Date:   Tue Jul 11 02:34:28 2017 +0800

    enhance source mapping on IIFEs (#2224)
    
    fixes #2213
---
 lib/output.js     | 3 +++
 test/mocha/cli.js | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/output.js b/lib/output.js
index 9416583..6ee96b3 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -1104,6 +1104,9 @@ function OutputStream(options) {
         self.expression.print(output);
         if (self instanceof AST_New && !need_constructor_parens(self, output))
             return;
+        if (self.expression instanceof AST_Lambda) {
+            output.add_mapping(self.start);
+        }
         output.with_parens(function(){
             self.args.forEach(function(expr, i){
                 if (i) output.comma();
diff --git a/test/mocha/cli.js b/test/mocha/cli.js
index 4c4943c..8bfdc85 100644
--- a/test/mocha/cli.js
+++ b/test/mocha/cli.js
@@ -63,7 +63,7 @@ describe("bin/uglifyjs", function () {
             if (err) throw err;
 
             assert.strictEqual(stdout, "var bar=function(){function foo(bar){return bar}return foo}();\n" +
-                "//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QvaW5wdXQvaXNzdWUtMTMyMy9zYW1wbGUuanMiXSwibmFtZXMiOlsiYmFyIiwiZm9vIl0sIm1hcHBpbmdzIjoiQUFBQSxJQUFJQSxJQUFNLFdBQ04sU0FBU0MsSUFBS0QsS0FDVixPQUFPQSxJQUdYLE9BQU9DIn0=\n");
+                "//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QvaW5wdXQvaXNzdWUtMTMyMy9zYW1wbGUuanMiXSwibmFtZXMiOlsiYmFyIiwiZm9vIl0sIm1hcHBpbmdzIjoiQUFBQSxJQUFJQSxJQUFNLFdBQ04sU0FBU0MsSUFBS0QsS0FDVixPQUFPQSxJQUdYLE9BQU9DLElBTEQifQ==\n");
             done();
         });
     });
@@ -192,7 +192,7 @@ describe("bin/uglifyjs", function () {
 
             assert.strictEqual(stdout, [
                 "var bar=function(){function foo(bar){return bar}return foo}();",
-                "//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QvaW5wdXQvaXNzdWUtMTMyMy9zYW1wbGUuanMiXSwibmFtZXMiOlsiYmFyIiwiZm9vIl0sIm1hcHBpbmdzIjoiQUFBQSxJQUFJQSxJQUFNLFdBQ04sU0FBU0MsSUFBS0QsS0FDVixPQUFPQSxJQUdYLE9BQU9DIn0=",
+                "//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QvaW5wdXQvaXNzdWUtMTMyMy9zYW1wbGUuanMiXSwibmFtZXMiOlsiYmFyIiwiZm9vIl0sIm1hcHBpbmdzIjoiQUFBQSxJQUFJQSxJQUFNLFdBQ04sU0FBU0MsSUFBS0QsS0FDVixPQUFPQSxJQUdYLE9BQU9DLElBTEQifQ==",
                 "",
             ].join("\n"));
             assert.strictEqual(stderr, "WARN: inline source map not found\n");

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