-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not handle declarations in modules without side effects as TDZ (#5322
- Loading branch information
1 parent
e004d92
commit ba1c2db
Showing
5 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
test/form/samples/tree-shake-nested-call-no-module-side-effects/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = defineTest({ | ||
description: 'properly tree-shakes nested function calls when moduleSideEffects are disabled', | ||
options: { | ||
treeshake: { | ||
moduleSideEffects: false | ||
} | ||
} | ||
}); |
4 changes: 4 additions & 0 deletions
4
test/form/samples/tree-shake-nested-call-no-module-side-effects/_expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const main = () => { | ||
}; | ||
|
||
export { main }; |
7 changes: 7 additions & 0 deletions
7
test/form/samples/tree-shake-nested-call-no-module-side-effects/alpha.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const doNothing = () => {}; | ||
|
||
const alpha = () => { | ||
doNothing(); | ||
}; | ||
|
||
export { alpha }; |
7 changes: 7 additions & 0 deletions
7
test/form/samples/tree-shake-nested-call-no-module-side-effects/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { alpha } from "./alpha"; | ||
|
||
const main = () => { | ||
alpha(); | ||
}; | ||
|
||
export { main }; |