-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from nul/master
Fixes issues with multiple await return.
- Loading branch information
Showing
5 changed files
with
39 additions
and
19 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
1 change: 1 addition & 0 deletions
1
src/NUglify.Tests/TestData/JS/Expected/ES2017/MultipleAwaitExpression.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
src/NUglify.Tests/TestData/JS/Input/ES2017/MultipleAwaitExpression.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 @@ | ||
async function getNumberAfterTimeout(value) { | ||
return new Promise((resolve) => { | ||
window.setTimeout(() => resolve(value), 2000); | ||
}); | ||
} | ||
|
||
async function sum(x) { | ||
var a = getNumberAfterTimeout(20); | ||
var b = getNumberAfterTimeout(30); | ||
return x + await a + await b; | ||
} | ||
|
||
(async () => { return x + await a(t) + await b; })() | ||
|
||
// keep grouping | ||
(async () => { return x + (await a(t) + await b); })() |
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