Skip to content

Commit

Permalink
When removing asserts preserve the assert tightened type on the remai…
Browse files Browse the repository at this point in the history
…ning expression.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125255697
  • Loading branch information
concavelenz authored and blickly committed Jun 20, 2016
1 parent b18d299 commit 329111b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/com/google/javascript/jscomp/ClosureCodeRemoval.java
Expand Up @@ -230,7 +230,9 @@ public void process(Node externs, Node root) {
if (firstArg == null) {
parent.replaceChild(call, NodeUtil.newUndefinedNode(call));
} else {
parent.replaceChild(call, firstArg.detachFromParent());
Node replacement = firstArg.detachFromParent();
replacement.setJSType(call.getJSType());
parent.replaceChild(call, replacement);
}
}
compiler.reportCodeChange();
Expand Down

0 comments on commit 329111b

Please sign in to comment.