have keep_quoted respect quoted method names (#2258)

fixes #2257
This commit is contained in:
kzc
2017-07-28 07:42:12 -04:00
committed by Alex Lam S.L
parent d3df2f985d
commit d600c78d7b
3 changed files with 45 additions and 9 deletions

View File

@@ -870,3 +870,37 @@ issue_2208_9: {
expect_stdout: "42"
node_version: ">=4"
}
methods_keep_quoted_true: {
options = {
arrows: true,
ecma: 6,
}
mangle_props = {
keep_quoted: true,
};
input: {
class C { "Quoted"(){} Unquoted(){} }
f1({ "Quoted"(){}, Unquoted(){}, "Prop": 3 });
f2({ "Quoted": function(){} });
f3({ "Quoted": ()=>{} });
}
expect_exact: "class C{Quoted(){}o(){}}f1({Quoted(){},o(){},Prop:3});f2({Quoted(){}});f3({Quoted(){}});"
}
methods_keep_quoted_false: {
options = {
arrows: true,
ecma: 6,
}
mangle_props = {
keep_quoted: false,
};
input: {
class C { "Quoted"(){} Unquoted(){} }
f1({ "Quoted"(){}, Unquoted(){}, "Prop": 3 });
f2({ "Quoted": function(){} });
f3({ "Quoted": ()=>{} });
}
expect_exact: "class C{o(){}d(){}}f1({o(){},d(){},e:3});f2({o(){}});f3({o(){}});"
}