Skip to content

Commit

Permalink
Remove unsafeClone from the list of methods that shouldn't take arrays.
Browse files Browse the repository at this point in the history
It has code to explicitly handle array, and since it's already "unsafe" it's reasonable to back off a little more and trust that the user knows what they're doing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148733158
  • Loading branch information
tbreisacher authored and brad4d committed Feb 28, 2017
1 parent 5b4b2c2 commit b3fbe37
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -23,7 +23,6 @@
import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.TypeI; import com.google.javascript.rhino.TypeI;


import java.util.Set;


/** /**
* Lints against passing arrays to goog.object methods with the intention of * Lints against passing arrays to goog.object methods with the intention of
Expand All @@ -35,7 +34,7 @@ public final class CheckArrayWithGoogObject extends NodeTraversal.AbstractPostOr
implements HotSwapCompilerPass { implements HotSwapCompilerPass {
final AbstractCompiler compiler; final AbstractCompiler compiler;


private static final Set<String> GOOG_OBJECT_METHODS = private static final ImmutableSet<String> GOOG_OBJECT_METHODS =
ImmutableSet.of( ImmutableSet.of(
"goog.object.forEach", "goog.object.forEach",
"goog.object.filter", "goog.object.filter",
Expand All @@ -55,7 +54,6 @@ public final class CheckArrayWithGoogObject extends NodeTraversal.AbstractPostOr
"goog.object.remove", "goog.object.remove",
"goog.object.equals", "goog.object.equals",
"goog.object.clone", "goog.object.clone",
"goog.object.unsafeClone",
"goog.object.transpose"); "goog.object.transpose");


public static final DiagnosticType ARRAY_PASSED_TO_GOOG_OBJECT = public static final DiagnosticType ARRAY_PASSED_TO_GOOG_OBJECT =
Expand Down

0 comments on commit b3fbe37

Please sign in to comment.