Add a test to verify that destructuring arguments work with #203 code

This commit is contained in:
Fábio Santos
2015-01-15 20:08:06 +00:00
committed by Richard van Velzen
parent 96b89e34a3
commit ad344c5be3
2 changed files with 30 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
compress_new_function: {
options = {
unsafe: true
}
input: {
new Function("aa, bb", 'return aa;');
}
expect: {
Function("a", "b", "return a");
}
}
compress_new_function_with_destruct: {
options = {
unsafe: true
}
input: {
new Function("aa, [bb]", 'return aa;');
new Function("aa, {bb}", 'return aa;');
new Function("[[aa]], [{bb}]", 'return aa;');
}
expect: {
Function("a", "[b]", "return a");
Function("a", "{bb}", "return a");
Function("[[a]]", "[{bb}]", 'return a');
}
}