Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: scripts/abprewrite.js

Issue 29345403: Issue 4088 - JSHydra-generated module scopes shouldn't be called immediately (Closed)
Patch Set: Created May 31, 2016, 11:36 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « autotest/test_abprewrite_module.js.expected ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/abprewrite.js
===================================================================
--- a/scripts/abprewrite.js
+++ b/scripts/abprewrite.js
@@ -551,19 +551,19 @@ process_js = function(ast, filename, arg
{
// Wrap the entire module into a function to give it an independent scope.
// Return exported symbols:
//
// require.scopes["foobar"] = (function() {
// var exports = {};
// ...
// return exports;
- // })();
+ // });
let code = 'require.scopes["' + options.filename + '"] = (function() {\n' +
decompileAST(ast).replace(/^("use strict";\n)?/,
"$1var exports = {};\n") +
'return exports;\n' +
- '})();\n';
+ '});\n';
_print(js_beautify(code, options));
}
else
_print(js_beautify(decompileAST(ast), options));
}
« no previous file with comments | « autotest/test_abprewrite_module.js.expected ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld