Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle out-of-order binding of identifiers to improve tree-shaking (#…
- Loading branch information
1 parent
479bf73
commit c3d73ff
Showing
4 changed files
with
35 additions
and
0 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
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: 'Simplifies conditionals in return expression' | ||
}; |
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,14 @@ | ||
const test = () => { | ||
console.log(foo()); | ||
console.log(bar()); | ||
}; | ||
|
||
const foo = () => { | ||
return A; | ||
}; | ||
|
||
const bar = () => { | ||
return A; | ||
}; | ||
|
||
export { test }; |
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,16 @@ | ||
export const test = () => { | ||
console.log(foo()); | ||
console.log(bar()); | ||
}; | ||
|
||
const foo = () => { | ||
return BUILD ? A : B; | ||
}; | ||
|
||
const bar = () => { | ||
return getBuild() ? A : B; | ||
}; | ||
|
||
const getBuild = () => BUILD; | ||
|
||
const BUILD = true; |