Skip to content

Commit

Permalink
Do not allow callers of Name.getRefs() to modify the refs list
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=232578832
  • Loading branch information
brad4d authored and tjgq committed Feb 7, 2019
1 parent 03f3753 commit 7b53da9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/GlobalNamespace.java
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ void removeRef(Ref ref) {
}

List<Ref> getRefs() {
return refs == null ? ImmutableList.of() : refs;
return refs == null ? ImmutableList.of() : Collections.unmodifiableList(refs);
}

private void addRefInternal(Ref ref) {
Expand Down

0 comments on commit 7b53da9

Please sign in to comment.