[Pkg-javascript-commits] [uglifyjs] 27/190: Fix mozilla-ast after module loading changes

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:10 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 6637c267a53ae7e21807da1da862fbae0bb880fd
Author: Mihai Bazon <mihai.bazon at gmail.com>
Date:   Thu Sep 24 18:12:06 2015 +0300

    Fix mozilla-ast after module loading changes
    
    Need to explicitly qualify stuff now, since it's not evaluated in some
    global scope.
    
    Ref #636
---
 lib/mozilla-ast.js  | 6 +++---
 test/mozilla-ast.js | 2 +-
 tools/exports.js    | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/mozilla-ast.js b/lib/mozilla-ast.js
index 1deb18e..ac53ca2 100644
--- a/lib/mozilla-ast.js
+++ b/lib/mozilla-ast.js
@@ -399,7 +399,7 @@
 
     function map(moztype, mytype, propmap) {
         var moz_to_me = "function From_Moz_" + moztype + "(M){\n";
-        moz_to_me += "return new " + mytype.name + "({\n" +
+        moz_to_me += "return new U2." + mytype.name + "({\n" +
             "start: my_start_token(M),\n" +
             "end: my_end_token(M)";
 
@@ -442,8 +442,8 @@
         //me_to_moz = parse(me_to_moz).print_to_string({ beautify: true });
         //console.log(moz_to_me);
 
-        moz_to_me = new Function("my_start_token", "my_end_token", "from_moz", "return(" + moz_to_me + ")")(
-            my_start_token, my_end_token, from_moz
+        moz_to_me = new Function("U2", "my_start_token", "my_end_token", "from_moz", "return(" + moz_to_me + ")")(
+            exports, my_start_token, my_end_token, from_moz
         );
         me_to_moz = new Function("to_moz", "to_moz_block", "return(" + me_to_moz + ")")(
             to_moz, to_moz_block
diff --git a/test/mozilla-ast.js b/test/mozilla-ast.js
index 0262867..b5c6c6e 100644
--- a/test/mozilla-ast.js
+++ b/test/mozilla-ast.js
@@ -100,4 +100,4 @@ module.exports = function(options) {
     }
 
     process.stdout.write(prefix + "Probability of error is less than " + (100 / options.iterations) + "%, stopping.\n");
-};
\ No newline at end of file
+};
diff --git a/tools/exports.js b/tools/exports.js
index a27cef9..5007e03 100644
--- a/tools/exports.js
+++ b/tools/exports.js
@@ -14,3 +14,4 @@ exports["merge"] = merge;
 exports["parse"] = parse;
 exports["push_uniq"] = push_uniq;
 exports["string_template"] = string_template;
+exports["is_identifier"] = is_identifier;

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