Skip to content

Commit

Permalink
Passes run in hotswap mode should not trust type information.
Browse files Browse the repository at this point in the history
In particular don't tell passes run in hotswap mode that type
checking has run for the AST they are modifying.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202325073
  • Loading branch information
brad4d committed Jun 28, 2018
1 parent 3424f31 commit 15d7004
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/com/google/javascript/jscomp/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -3289,7 +3289,9 @@ private void processNewScript(JsAst ast, Node originalRoot) {
// to revisit this approach to clearing GlobalNamespaces
runHotSwapPass(null, null, ensureDefaultPassConfig().garbageCollectChecks);

// Type information is not reliable for hotswap runs.
this.getTypeRegistry().clearNamedTypes();
this.typeCheckingHasRun = false;
this.removeSyntheticVarsInput();

runHotSwap(originalRoot, js, this.ensureDefaultPassConfig());
Expand Down

0 comments on commit 15d7004

Please sign in to comment.