Index: scripts/abprewrite.js |
=================================================================== |
--- a/scripts/abprewrite.js |
+++ b/scripts/abprewrite.js |
@@ -558,8 +558,7 @@ |
// return exports; |
// })(); |
let code = 'require.scopes["' + options.filename + '"] = (function() {\n' + |
- 'var exports = {};\n' + |
- decompileAST(ast) + |
+ decompileAST(ast).replace(/^("use strict";\n)?/, "$1var exports = {};\n") + |
kzar
2016/03/17 13:56:47
I guess this assumes that they'll always be a newl
kzar
2016/03/17 13:56:47
Nit: Mind wrapping this long line?
Sebastian Noack
2016/03/17 14:10:26
As well as it assumes that double quotes are used,
Sebastian Noack
2016/03/17 14:10:26
Done.
|
'return exports;\n' + |
'})();\n'; |
_print(js_beautify(code, options)); |