-
-
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.
Tree-shake unused declarations while keeping initializer side-effects
- Loading branch information
1 parent
e23bb35
commit 90b3fcd
Showing
136 changed files
with
252 additions
and
2,135 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
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
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
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
2 changes: 1 addition & 1 deletion
2
test/chunking-form/samples/preserve-entry-signatures/false/_expected/es/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
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
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
18 changes: 9 additions & 9 deletions
18
test/form/samples/builtin-prototypes/object-expression/_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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
const object = {}; | ||
const propertyIsEnumerable1 = object.propertyIsEnumerable( 'toString' ); | ||
const propertyIsEnumerable2 = {}.propertyIsEnumerable( 'toString' ); | ||
const propertyIsEnumerable3 = {}.propertyIsEnumerable( 'toString' ).valueOf(); | ||
object.propertyIsEnumerable( 'toString' ); | ||
{}.propertyIsEnumerable( 'toString' ); | ||
{}.propertyIsEnumerable( 'toString' ).valueOf(); | ||
|
||
const _hasOwnProperty = {}.hasOwnProperty( 'toString' ).valueOf(); | ||
const _isPrototypeOf = {}.isPrototypeOf( {} ).valueOf(); | ||
const _propertyIsEnumerable = {}.propertyIsEnumerable( 'toString' ).valueOf(); | ||
const _toLocaleString = {}.toLocaleString().trim(); | ||
const _toString = {}.toString().trim(); | ||
const _valueOf = {}.valueOf(); | ||
{}.hasOwnProperty( 'toString' ).valueOf(); | ||
{}.isPrototypeOf( {} ).valueOf(); | ||
{}.propertyIsEnumerable( 'toString' ).valueOf(); | ||
{}.toLocaleString().trim(); | ||
{}.toString().trim(); | ||
{}.valueOf(); |
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,17 @@ | ||
// side-effect in condition | ||
foo() ? 1 : 2; | ||
|
||
var unknownValue = bar(); | ||
|
||
// unknown branch with side-effect | ||
unknownValue ? foo() : 2; | ||
unknownValue ? 1 : foo(); | ||
(unknownValue ? function () {} : function () {this.x = 1;})(); | ||
|
||
// known side-effect | ||
foo() ; | ||
( function () {this.x = 1;} )(); | ||
( () => () => console.log( 'effect' ) )()(); | ||
foo(); | ||
( function () {this.x = 1;})(); | ||
( () => () => console.log( 'effect' ))()(); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.