Add a fake require to go with the fake exports.

This commit is contained in:
Chad Weider 2012-01-15 19:46:50 -08:00
parent fc68a25b21
commit da95016228
3 changed files with 9 additions and 1 deletions

View file

@ -303,8 +303,11 @@ function tarCode(filesInOrder, files, write) {
// Wrap the following code in a self executing function and assign exports to
// global. This is a first step towards removing symbols from the global scope.
// exports is global and require is a function that returns global.
function isolateJS(code) {
return '(function (exports) {'+code+'\n}(function () {return this}()));\n';
return '(function (exports, require) {'
+ code + '\n'
+ '}(function () {return this}(), (function (path) {return (function () {return this}())})));\n';
}
function compressJS(values)