Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59b8673
commit 8949aaa
Showing
27 changed files
with
178 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
description: 'handles binary expression 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,25 @@ | ||
if ((1 + 1).unknown) { | ||
console.log('retained'); | ||
} else { | ||
console.log('retained'); | ||
} | ||
console.log('retained 1'); | ||
console.log('retained 2'); | ||
console.log('retained 3'); | ||
console.log('retained 4'); | ||
console.log('retained 5'); | ||
console.log('retained 6'); | ||
console.log('retained 7'); | ||
console.log('retained 8'); | ||
console.log('retained 9'); | ||
console.log('retained 10'); | ||
console.log('retained 11'); | ||
console.log('retained 12'); | ||
console.log('retained 13'); | ||
console.log('retained 14'); | ||
console.log('retained 15'); | ||
console.log('retained 16'); | ||
console.log('retained 17'); | ||
if (1 in 2) console.log('retained 18'); | ||
if (1 instanceof 2) console.log('retained 19'); | ||
console.log('retained 20'); |
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,28 @@ | ||
if ((1 + 1).unknown) { | ||
console.log('retained'); | ||
} else { | ||
console.log('retained'); | ||
} | ||
|
||
if (1 != '1') console.log('removed'); | ||
if (1 !== 1) console.log('removed'); | ||
if (4 % 2 === 0) console.log('retained 1'); | ||
if ((6 & 3) === 2) console.log('retained 2'); | ||
if (2 * 3 === 6) console.log('retained 3'); | ||
if (2 ** 3 === 8) console.log('retained 4'); | ||
if (2 + 3 === 5) console.log('retained 5'); | ||
if (3 - 2 === 1) console.log('retained 6'); | ||
if (6 / 3 === 2) console.log('retained 7'); | ||
if (1 < 2 ) console.log('retained 8'); | ||
if (3 << 1 === 6) console.log('retained 9'); | ||
if (3 <= 4) console.log('retained 10'); | ||
if (1 == '1') console.log('retained 11'); | ||
if (1 === 1) console.log('retained 12'); | ||
if (3 > 2) console.log('retained 13'); | ||
if (3 >= 2) console.log('retained 14'); | ||
if (6 >> 1 === 3) console.log('retained 15'); | ||
if (-1 >>> 28 === 15) console.log('retained 16'); | ||
if (3 ^ 5 === 6) console.log('retained 17'); | ||
if (1 in 2) console.log('retained 18'); | ||
if (1 instanceof 2) console.log('retained 19'); | ||
if (2 | 4 === 6) console.log('retained 20'); |
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
3 changes: 1 addition & 2 deletions
3
test/form/samples/builtin-prototypes/array-expression/_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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
module.exports = { | ||
description: 'Tree-shake known array prototype functions', | ||
options: { output: { name: 'bundle' } } | ||
description: 'Tree-shake known array prototype functions' | ||
}; |
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
11 changes: 11 additions & 0 deletions
11
test/form/samples/class-constructor-side-effect/_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,11 @@ | ||
class Effect { | ||
constructor () { | ||
console.log( 'Foo' ); | ||
} | ||
} | ||
|
||
new Effect(); | ||
|
||
class Empty {} | ||
|
||
new Empty.doesNotExist(); |
11 changes: 0 additions & 11 deletions
11
test/form/samples/class-constructor-side-effect/_expected/amd.js
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
test/form/samples/class-constructor-side-effect/_expected/cjs.js
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
test/form/samples/class-constructor-side-effect/_expected/es.js
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
test/form/samples/class-constructor-side-effect/_expected/iife.js
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
test/form/samples/class-constructor-side-effect/_expected/system.js
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
test/form/samples/class-constructor-side-effect/_expected/umd.js
This file was deleted.
Oops, something went wrong.
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,7 +1,18 @@ | ||
class Foo { | ||
class Effect { | ||
constructor () { | ||
console.log( 'Foo' ); | ||
} | ||
} | ||
|
||
new Foo; | ||
new Effect(); | ||
|
||
class NoEffect { | ||
constructor () { | ||
} | ||
} | ||
|
||
new NoEffect(); | ||
|
||
class Empty {} | ||
|
||
new Empty.doesNotExist(); |
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 |
---|---|---|
|
@@ -30,3 +30,7 @@ switch ( globalThis.unknown ) { | |
effect(); | ||
} | ||
}()); | ||
|
||
switch ( globalThis.unknown ) { | ||
case effect(): | ||
} |
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 |
---|---|---|
|
@@ -44,3 +44,7 @@ switch ( globalThis.unknown ) { | |
default: | ||
} | ||
}()); | ||
|
||
switch ( globalThis.unknown ) { | ||
case effect(): | ||
} |
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: 'handles unary expression 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,13 @@ | ||
if ((!true).unknown) { | ||
console.log('retained'); | ||
} else { | ||
console.log('retained'); | ||
} | ||
|
||
console.log('retained 1'); | ||
console.log('retained 2'); | ||
console.log('retained 3'); | ||
if (delete 1) console.log('retained 4'); | ||
console.log('retained 5'); | ||
console.log('retained 6'); | ||
console.log('retained 7'); |
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,13 @@ | ||
if ((!true).unknown) { | ||
console.log('retained'); | ||
} else { | ||
console.log('retained'); | ||
} | ||
|
||
if (!false) console.log('retained 1'); | ||
if (+'1' === 1) console.log('retained 2'); | ||
if (-1 + 2 === 1) console.log('retained 3'); | ||
if (delete 1) console.log('retained 4'); | ||
if (typeof 1 === 'number') console.log('retained 5'); | ||
if (void 1 === undefined) console.log('retained 6'); | ||
if (~1 === -2) console.log('retained 7'); |
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,8 +1,10 @@ | ||
var z; | ||
console.log('no'); | ||
console.log('no'); | ||
if (z) | ||
console.log('yes'); | ||
if (!z) | ||
console.log('no'); | ||
|
||
console.log('retained'); | ||
|
||
console.log('retained'); | ||
|
||
if (z) console.log('retained'); | ||
else console.log('retained'); | ||
|
||
z = 1; |
Oops, something went wrong.