Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not create invalid code if a function argument is an empty object …
…pattern (#3998)
- Loading branch information
1 parent
770da18
commit 9cae40d
Showing
3 changed files
with
23 additions
and
6 deletions.
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/function/samples/unused-parameter-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: 'does not tree-shake arguments where the corresponding parameters have side-effects' | ||
}; |
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,9 @@ | ||
let sideEffects = 0; | ||
|
||
function destructured({}) { | ||
sideEffects++; | ||
} | ||
|
||
destructured({}); | ||
|
||
assert.strictEqual(sideEffects, 1); |