acorn = require("acorn");
}
-var COMPRESS = getOptions("c", true);
-var MANGLE = getOptions("m", true);
+var COMPRESS = getOptions("c", true) || {};
+var MANGLE = getOptions("m", true) || {};
var BEAUTIFY = getOptions("b", true);
-if (COMPRESS && ARGS.d) {
+if (ARGS.d) {
COMPRESS.global_defs = getOptions("d");
}
-if (MANGLE && ARGS.r) {
- MANGLE.except = ARGS.r.replace(/^\s+|\s+$/g).split(/\s*,+\s*/);
+if (ARGS.screw_ie8) {
+ COMPRESS.screw_ie8 = true;
+ MANGLE.screw_ie8 = true;
}
-if (MANGLE && ARGS.screw_ie8) {
- MANGLE.screw_ie8 = true;
+if (ARGS.r) {
+ MANGLE.except = ARGS.r.replace(/^\s+|\s+$/g).split(/\s*,+\s*/);
}
var OUTPUT_OPTIONS = {
join_vars : !false_by_default,
cascade : !false_by_default,
side_effects : !false_by_default,
+ screw_ie8 : false,
warnings : true,
global_defs : {}
var prop = self.property;
if (prop instanceof AST_String && compressor.option("properties")) {
prop = prop.getValue();
- if (is_identifier(prop)) {
+ if (is_identifier(prop) || compressor.option("screw_ie8")) {
return make_node(AST_Dot, self, {
expression : self.expression,
property : prop