Screw IE by default

- Set the screw_ie8 option to true by default
- Rename the --screw-ie8  flag to --support-old-ie (boolean)
- Flip the screw_ie8 properties test
This commit is contained in:
Matej Kieres 2016-01-26 01:16:53 +01:00
parent b5a7197ae5
commit c1f2053dd4
6 changed files with 14 additions and 14 deletions

View File

@ -65,7 +65,7 @@ The available options are:
--in-source-map Input source map, useful if you're compressing --in-source-map Input source map, useful if you're compressing
JS that was generated from some other original JS that was generated from some other original
code. code.
--screw-ie8 Pass this flag if you don't care about full --support-old-ie Pass this flag if you don't care about full
compliance with Internet Explorer 6-8 quirks compliance with Internet Explorer 6-8 quirks
(by default UglifyJS will try to be IE-proof). (by default UglifyJS will try to be IE-proof).
--expr Parse a single expression, rather than a --expr Parse a single expression, rather than a

View File

@ -24,7 +24,7 @@ mangling you need to use `-c` and `-m`.\
.describe("source-map-url", "The path to the source map to be added in //# sourceMappingURL. Defaults to the value passed with --source-map.") .describe("source-map-url", "The path to the source map to be added in //# sourceMappingURL. Defaults to the value passed with --source-map.")
.describe("source-map-include-sources", "Pass this flag if you want to include the content of source files in the source map as sourcesContent property.") .describe("source-map-include-sources", "Pass this flag if you want to include the content of source files in the source map as sourcesContent property.")
.describe("in-source-map", "Input source map, useful if you're compressing JS that was generated from some other original code.") .describe("in-source-map", "Input source map, useful if you're compressing JS that was generated from some other original code.")
.describe("screw-ie8", "Pass this flag if you don't care about full compliance with Internet Explorer 6-8 quirks (by default UglifyJS will try to be IE-proof).") .describe("support-old-ie", "Pass this flag if you care about full compliance with Internet Explorer 6-8 quirks (by default UglifyJS will try to be IE-proof).")
.describe("expr", "Parse a single expression, rather than a program (for parsing JSON)") .describe("expr", "Parse a single expression, rather than a program (for parsing JSON)")
.describe("p", "Skip prefix for original filenames that appear in source maps. \ .describe("p", "Skip prefix for original filenames that appear in source maps. \
For example -p 3 will drop 3 directories from file names and ensure they are relative paths. \ For example -p 3 will drop 3 directories from file names and ensure they are relative paths. \
@ -110,7 +110,7 @@ You need to pass an argument to this option to specify the name that your module
.boolean("expr") .boolean("expr")
.boolean("source-map-include-sources") .boolean("source-map-include-sources")
.boolean("screw-ie8") .boolean("support-old-ie")
.boolean("export-all") .boolean("export-all")
.boolean("self") .boolean("self")
.boolean("v") .boolean("v")
@ -219,10 +219,10 @@ var OUTPUT_OPTIONS = {
quote_style : ARGS.quotes != null ? ARGS.quotes : 0 quote_style : ARGS.quotes != null ? ARGS.quotes : 0
}; };
if (ARGS.screw_ie8) { if (ARGS.support_old_ie) {
if (COMPRESS) COMPRESS.screw_ie8 = true; if (COMPRESS) COMPRESS.screw_ie8 = false;
if (MANGLE) MANGLE.screw_ie8 = true; if (MANGLE) MANGLE.screw_ie8 = false;
OUTPUT_OPTIONS.screw_ie8 = true; OUTPUT_OPTIONS.screw_ie8 = false;
} }
if (ARGS.keep_fnames) { if (ARGS.keep_fnames) {

View File

@ -71,7 +71,7 @@ function Compressor(options, false_by_default) {
pure_getters : false, pure_getters : false,
pure_funcs : null, pure_funcs : null,
negate_iife : !false_by_default, negate_iife : !false_by_default,
screw_ie8 : false, screw_ie8 : true,
drop_console : false, drop_console : false,
angular : false, angular : false,

View File

@ -62,7 +62,7 @@ function OutputStream(options) {
comments : false, comments : false,
shebang : true, shebang : true,
preserve_line : false, preserve_line : false,
screw_ie8 : false, screw_ie8 : true,
preamble : null, preamble : null,
quote_style : 0 quote_style : 0
}, true); }, true);

View File

@ -85,7 +85,7 @@ SymbolDef.prototype = {
AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
options = defaults(options, { options = defaults(options, {
screw_ie8: false, screw_ie8: true,
cache: null cache: null
}); });
@ -373,7 +373,7 @@ AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options){
eval : false, eval : false,
sort : false, sort : false,
toplevel : false, toplevel : false,
screw_ie8 : false, screw_ie8 : true,
keep_fnames : false keep_fnames : false
}); });
}); });

View File

@ -12,7 +12,8 @@ keep_properties: {
dot_properties: { dot_properties: {
options = { options = {
properties: true properties: true,
screw_ie8: false
}; };
input: { input: {
a["foo"] = "bar"; a["foo"] = "bar";
@ -34,8 +35,7 @@ dot_properties: {
dot_properties_es5: { dot_properties_es5: {
options = { options = {
properties: true, properties: true
screw_ie8: true
}; };
input: { input: {
a["foo"] = "bar"; a["foo"] = "bar";