fix issues related to export & function (#2002)

- `unused` function names
- confusion with function call syntax

fixes #2001
This commit is contained in:
Alex Lam S.L
2017-05-26 03:12:52 +08:00
committed by GitHub
parent c988e5f4d6
commit 02811ce35e
3 changed files with 71 additions and 2 deletions

View File

@@ -0,0 +1,63 @@
export_func_1: {
options = {
unused: true,
}
input: {
export function f(){};
}
expect_exact: "export function f(){};"
}
export_func_2: {
options = {
side_effects: false,
unused: true,
}
input: {
export function f(){}(1);
}
expect_exact: "export function f(){};1;"
}
export_func_3: {
options = {
side_effects: true,
unused: true,
}
input: {
export function f(){}(1);
}
expect_exact: "export function f(){};"
}
export_default_func_1: {
options = {
unused: true,
}
input: {
export default function f(){};
}
expect_exact: "export default function(){};"
}
export_default_func_2: {
options = {
side_effects: false,
unused: true,
}
input: {
export default function f(){}(1);
}
expect_exact: "export default function(){};1;"
}
export_default_func_3: {
options = {
side_effects: true,
unused: true,
}
input: {
export default function f(){}(1);
}
expect_exact: "export default function(){};"
}