Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: conditional/logical expression should request a new tree-shaking (…
…#5481) * fix: conditional/logical expression should request a new tree-shaking * perf: rarely expressionsToBeDeoptimized.length > 0, so move it outside
- Loading branch information
Showing
5 changed files
with
60 additions
and
13 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
3 changes: 3 additions & 0 deletions
3
test/form/samples/request-tree-shaking-before-render/_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 = defineTest({ | ||
description: 'a new tree-shaking is required so render will not fail' | ||
}); |
16 changes: 16 additions & 0 deletions
16
test/form/samples/request-tree-shaking-before-render/_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,16 @@ | ||
function s(t) { | ||
t(x); | ||
} | ||
|
||
function f(b) { | ||
return x.concat((b ? 1 : 0)) | ||
} | ||
|
||
function w(b) { | ||
f(b); | ||
} | ||
|
||
w(1); | ||
s(() => { | ||
return w(0) | ||
}); |
16 changes: 16 additions & 0 deletions
16
test/form/samples/request-tree-shaking-before-render/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,16 @@ | ||
function s(t) { | ||
t(x) | ||
} | ||
|
||
function f(b) { | ||
return x.concat((b ? 1 : 0)) | ||
} | ||
|
||
function w(b) { | ||
f(b) | ||
} | ||
|
||
w(1) | ||
s(() => { | ||
return w(0) | ||
}) |