Skip to content

Commit

Permalink
Fix mozilla-ast after module loading changes
Browse files Browse the repository at this point in the history
Need to explicitly qualify stuff now, since it's not evaluated in some
global scope.

Ref #636
  • Loading branch information
mishoo committed Sep 24, 2015
1 parent 99233c4 commit 6637c26
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/mozilla-ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)";

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/mozilla-ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ module.exports = function(options) {
}

process.stdout.write(prefix + "Probability of error is less than " + (100 / options.iterations) + "%, stopping.\n");
};
};
1 change: 1 addition & 0 deletions tools/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 6637c26

Please sign in to comment.