From b3fbe37de263ec0a29ed7baff3e98ee1c678c49b Mon Sep 17 00:00:00 2001 From: tbreisacher Date: Mon, 27 Feb 2017 21:50:32 -0800 Subject: [PATCH] Remove unsafeClone from the list of methods that shouldn't take arrays. 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 --- .../javascript/jscomp/lint/CheckArrayWithGoogObject.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/com/google/javascript/jscomp/lint/CheckArrayWithGoogObject.java b/src/com/google/javascript/jscomp/lint/CheckArrayWithGoogObject.java index 35ea050c567..1efef0752b5 100644 --- a/src/com/google/javascript/jscomp/lint/CheckArrayWithGoogObject.java +++ b/src/com/google/javascript/jscomp/lint/CheckArrayWithGoogObject.java @@ -23,7 +23,6 @@ import com.google.javascript.rhino.Node; import com.google.javascript.rhino.TypeI; -import java.util.Set; /** * Lints against passing arrays to goog.object methods with the intention of @@ -35,7 +34,7 @@ public final class CheckArrayWithGoogObject extends NodeTraversal.AbstractPostOr implements HotSwapCompilerPass { final AbstractCompiler compiler; - private static final Set GOOG_OBJECT_METHODS = + private static final ImmutableSet GOOG_OBJECT_METHODS = ImmutableSet.of( "goog.object.forEach", "goog.object.filter", @@ -55,7 +54,6 @@ public final class CheckArrayWithGoogObject extends NodeTraversal.AbstractPostOr "goog.object.remove", "goog.object.equals", "goog.object.clone", - "goog.object.unsafeClone", "goog.object.transpose"); public static final DiagnosticType ARRAY_PASSED_TO_GOOG_OBJECT =