Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not tree-shake arguments with side-effects (#2924)
- Loading branch information
1 parent
355c690
commit 9418822
Showing
4 changed files
with
25 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
3 changes: 3 additions & 0 deletions
3
test/form/samples/treeshake-excess-arguments/argument-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,3 @@ | ||
module.exports = { | ||
description: 'retains arguments that have side-effects' | ||
}; |
10 changes: 10 additions & 0 deletions
10
test/form/samples/treeshake-excess-arguments/argument-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,10 @@ | ||
function sideEffects() { | ||
console.log('print message'); | ||
return true; | ||
} | ||
|
||
function hola(a, b) { | ||
console.log(a); | ||
} | ||
|
||
hola(1, sideEffects()); |
10 changes: 10 additions & 0 deletions
10
test/form/samples/treeshake-excess-arguments/argument-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,10 @@ | ||
function sideEffects() { | ||
console.log('print message'); | ||
return true; | ||
} | ||
|
||
function hola(a, b) { | ||
console.log(a); | ||
} | ||
|
||
hola(1, sideEffects()); |