mangle destructuring function parameters (#2029)

fixes #2025
This commit is contained in:
Alex Lam S.L
2017-05-30 23:41:55 +08:00
committed by GitHub
parent 0cc6dedccc
commit 23265ac253
3 changed files with 6 additions and 16 deletions

View File

@@ -562,9 +562,8 @@ anon_func_with_destructuring_args: {
})({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)
(function({foo: o = 1, bar: n = 2}, [a = 3, b = 4]) {
console.log(o, n, a, b);
})({bar: 5}, [, 6]);
}
expect_stdout: "1 5 3 6"
@@ -589,9 +588,8 @@ arrow_func_with_destructuring_args: {
})({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)
(({foo: o = 1, bar: n = 2}, [a = 3, b = 4]) => {
console.log(o, n, a, b);
})({bar: 5}, [, 6]);
}
expect_stdout: "1 5 3 6"

View File

@@ -26,9 +26,7 @@ compress_new_function_with_destruct: {
}
expect: {
Function("a", "[b]", "return a");
Function("a", "{bb}", "return a");
Function("[[a]]", "[{bb}]", 'return a');
Function("a", "{bb:b}", "return a");
Function("[[a]]", "[{bb:b}]", 'return a');
}
}