Skip to content

Commit

Permalink
Rename recordInvalidations to withInvalidationMap.
Browse files Browse the repository at this point in the history
The name recordInvalidations implies that the class should pass a non-empty map of invalidations which will be recorded. In fact, when this is called, the caller passes a mutable empty map, which the Builder later uses to record invalidations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191763716
  • Loading branch information
tbreisacher authored and lauraharker committed Apr 6, 2018
1 parent 65b6843 commit 1755a35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -337,7 +337,7 @@ boolean scheduleRenaming(Node node, TypeI type) {
this.invalidationMap = propertiesToErrorFor.isEmpty() ? null : LinkedHashMultimap.create(); this.invalidationMap = propertiesToErrorFor.isEmpty() ? null : LinkedHashMultimap.create();


this.invalidatingTypes = new InvalidatingTypes.Builder(registry) this.invalidatingTypes = new InvalidatingTypes.Builder(registry)
.recordInvalidations(this.invalidationMap) .writeInvalidationsInto(this.invalidationMap)
.addTypesInvalidForPropertyRenaming() .addTypesInvalidForPropertyRenaming()
.addAllTypeMismatches(compiler.getTypeMismatches()) .addAllTypeMismatches(compiler.getTypeMismatches())
.addAllTypeMismatches(compiler.getImplicitInterfaceUses()) .addAllTypeMismatches(compiler.getImplicitInterfaceUses())
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/InvalidatingTypes.java
Expand Up @@ -91,7 +91,7 @@ InvalidatingTypes build() {
// TODO(sdh): Investigate whether this can be consolidated between all three passes. // TODO(sdh): Investigate whether this can be consolidated between all three passes.
// In particular, mutation testing suggests allowEnums=true should work everywhere. // In particular, mutation testing suggests allowEnums=true should work everywhere.
// We should revisit what breaks when we disallow scalars everywhere. // We should revisit what breaks when we disallow scalars everywhere.
Builder recordInvalidations(@Nullable Multimap<TypeI, Supplier<JSError>> invalidationMap) { Builder writeInvalidationsInto(@Nullable Multimap<TypeI, Supplier<JSError>> invalidationMap) {
this.invalidationMap = invalidationMap; this.invalidationMap = invalidationMap;
return this; return this;
} }
Expand Down

0 comments on commit 1755a35

Please sign in to comment.