Skip to content

Commit

Permalink
Add a toString() for easier debugging, and fix a typo
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143580191
  • Loading branch information
tbreisacher authored and blickly committed Jan 5, 2017
1 parent 28fc969 commit dab1c9e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/com/google/javascript/jscomp/MakeDeclaredNamesUnique.java
Expand Up @@ -15,6 +15,8 @@
*/
package com.google.javascript.jscomp;

import static com.google.common.base.MoreObjects.toStringHelper;

import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import com.google.common.collect.HashMultiset;
Expand Down Expand Up @@ -445,6 +447,15 @@ static class ContextualRenamer implements Renamer {

static final String UNIQUE_ID_SEPARATOR = "$jscomp$";

@Override
public String toString() {
return toStringHelper(this)
.add("nameUsage", nameUsage)
.add("declarations", declarations)
.add("global", global)
.toString();
}

ContextualRenamer() {
global = true;
nameUsage = HashMultiset.create();
Expand All @@ -471,8 +482,8 @@ private ContextualRenamer(
* Create a ContextualRenamer
*/
@Override
public Renamer forChildScope(boolean hoistintTargetScope) {
return new ContextualRenamer(nameUsage, hoistintTargetScope, this);
public Renamer forChildScope(boolean hoistingTargetScope) {
return new ContextualRenamer(nameUsage, hoistingTargetScope, this);
}

/**
Expand Down

0 comments on commit dab1c9e

Please sign in to comment.