fixes #259: don't unnecessarily quote object properties when --screw-ie8
This commit is contained in:
@@ -54,13 +54,13 @@ function OutputStream(options) {
|
||||
inline_script : false,
|
||||
width : 80,
|
||||
max_line_len : 32000,
|
||||
ie_proof : true,
|
||||
beautify : false,
|
||||
source_map : null,
|
||||
bracketize : false,
|
||||
semicolons : true,
|
||||
comments : false,
|
||||
preserve_line : false,
|
||||
screw_ie8 : false,
|
||||
negate_iife : !(options && options.beautify),
|
||||
}, true);
|
||||
|
||||
@@ -761,7 +761,7 @@ function OutputStream(options) {
|
||||
if (!self.body)
|
||||
return output.force_semicolon();
|
||||
if (self.body instanceof AST_Do
|
||||
&& output.option("ie_proof")) {
|
||||
&& !output.option("screw_ie8")) {
|
||||
// https://github.com/mishoo/UglifyJS/issues/#issue/57 IE
|
||||
// croaks with "syntax error" on code like this: if (foo)
|
||||
// do ... while(cond); else ... we need block brackets
|
||||
@@ -1048,10 +1048,10 @@ function OutputStream(options) {
|
||||
&& +key + "" == key)
|
||||
&& parseFloat(key) >= 0) {
|
||||
output.print(make_num(key));
|
||||
} else if (!is_identifier(key)) {
|
||||
output.print_string(key);
|
||||
} else {
|
||||
} else if (RESERVED_WORDS(key) ? output.option("screw_ie8") : is_identifier_string(key)) {
|
||||
output.print_name(key);
|
||||
} else {
|
||||
output.print_string(key);
|
||||
}
|
||||
output.colon();
|
||||
self.value.print(output);
|
||||
|
||||
Reference in New Issue
Block a user