Respect quote style in object literals

The option added in fbbaa42ee5 wasn't
being respected inside object literals, so quoted property names would
still be stripped out with this option.

This is mostly a corner-case, but useful when the output is passed to
something like the Closure compiler, where quoted property names can be
used to prevent mangling.
This commit is contained in:
Shrey Banga
2016-05-05 13:44:59 -07:00
committed by Richard van Velzen
parent 6c99816855
commit e645ba84cf
7 changed files with 158 additions and 17 deletions

View File

@@ -108,7 +108,11 @@ function run_compress_tests() {
expect = test.expect_exact;
}
var input = as_toplevel(test.input);
var input_code = make_code(test.input, { beautify: true });
var input_code = make_code(test.input, {
beautify: true,
quote_style: 3,
keep_quoted_props: true
});
if (test.mangle_props) {
input = U.mangle_properties(input, test.mangle_props);
}