Skip to content

Commit

Permalink
Partial rollback of
Browse files Browse the repository at this point in the history
3aea836

*** Reason for rollback ***

This is no longer necessary now that we calculate side effects correctly for 'await' nodes.

*** Original change description ***

Don't remove unused 'await' expressions

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176433132
  • Loading branch information
tbreisacher authored and lauraharker committed Nov 21, 2017
1 parent 42e29df commit 8a26437
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/com/google/javascript/jscomp/PeepholeRemoveDeadCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,6 @@ private Node trySimplifyUnusedResult(Node n, boolean removeUnused) {
result = n;
}
break;
case AWAIT:
// If there's an 'await' node whose result isn't used, it's still important to wait
// for the promise to resolve before running the next line, so don't remove it.
break;
default:
if (!nodeTypeMayHaveSideEffects(n)) {
// This is the meat of this function. The node itself doesn't generate
Expand Down

0 comments on commit 8a26437

Please sign in to comment.