Skip to content

Commit 2e26fde

Browse files
committed
revert changes that added "(function(){" around code when minifying - Esprima behaves very strangely when that happens (and it looks like we never actually used it)
1 parent 38537d7 commit 2e26fde

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

plugins/minify.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -195,24 +195,11 @@
195195
};
196196
})();
197197

198-
var minifyCode = code;
199-
var minifyCallback = callback;
200-
if (isModule) {
201-
/* if we're a module, we wrap this in a function so that unused constants
202-
and functions can be removed */
203-
var header = "(function(){";
204-
var footer = "})();";
205-
minifyCode = header+code+footer;
206-
minifyCallback = function (minified){
207-
callback(minified.substr(header.length, minified.length-(header.length+footer.length+1)));
208-
}
209-
}
210-
211198
switch(level){
212199
case "WHITESPACE_ONLY":
213200
case "SIMPLE_OPTIMIZATIONS":
214-
case "ADVANCED_OPTIMIZATIONS": minifyCodeGoogle(minifyCode, minifyCallback, level, description); break;
215-
case "ESPRIMA": minifyCodeEsprima(minifyCode, minifyCallback, description); break;
201+
case "ADVANCED_OPTIMIZATIONS": minifyCodeGoogle(code, callback, level, description); break;
202+
case "ESPRIMA": minifyCodeEsprima(code, callback, description); break;
216203
default: callback(code); break;
217204
}
218205
}

0 commit comments

Comments
 (0)