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

Unified Diff: scripts/abprewrite.js

Issue 29338486: Issue 3822 - Fix strict-mode in generated modules (Closed)
Patch Set: Wrapped long line Created March 17, 2016, 2:08 p.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 | « no previous file | 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
@@ -558,8 +558,8 @@
// return exports;
// })();
let code = 'require.scopes["' + options.filename + '"] = (function() {\n' +
- 'var exports = {};\n' +
- decompileAST(ast) +
+ decompileAST(ast).replace(/^("use strict";\n)?/,
+ "$1var exports = {};\n") +
'return exports;\n' +
'})();\n';
_print(js_beautify(code, options));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld