fix compress of IIFE with destructuring args (#2022)

This commit is contained in:
kzc
2017-05-30 01:17:06 -04:00
committed by Alex Lam S.L
parent c2e471e3ad
commit ec63588496
2 changed files with 64 additions and 8 deletions

View File

@@ -543,3 +543,57 @@ mangle_destructuring_decl_array: {
expect_stdout: "8 7 6 undefined 2 [ 3 ]"
node_version: ">=6"
}
anon_func_with_destructuring_args: {
options = {
evaluate: true,
unused: true,
toplevel: true,
}
mangle = {
toplevel: true,
}
beautify = {
ecma: 5,
}
input: {
(function({foo = 1 + 0, bar = 2}, [car = 3, far = 4]) {
console.log(foo, bar, car, far);
})({bar: 5 - 0}, [, 6]);
}
expect: {
(function({foo: foo = 1, bar: bar = 2}, [o = 3, a = 4]){
// FIXME: `foo` and `bar` should be mangled
console.log(foo, bar, o, a)
})({bar: 5}, [, 6]);
}
expect_stdout: "1 5 3 6"
node_version: ">=6"
}
arrow_func_with_destructuring_args: {
options = {
evaluate: true,
unused: true,
toplevel: true,
}
mangle = {
toplevel: true,
}
beautify = {
ecma: 5,
}
input: {
(({foo = 1 + 0, bar = 2}, [car = 3, far = 4]) => {
console.log(foo, bar, car, far);
})({bar: 5 - 0}, [, 6]);
}
expect: {
(({foo: foo = 1, bar: bar = 2},[o = 3, a = 4]) => {
// FIXME: `foo` and `bar` should be mangled
console.log(foo, bar, o, a)
})({bar: 5}, [, 6]);
}
expect_stdout: "1 5 3 6"
node_version: ">=6"
}