From e41e8d13f3b1d3101b47df73bb2f582b8cdb51e2 Mon Sep 17 00:00:00 2001 From: rluble Date: Tue, 11 Dec 2018 12:09:08 -0800 Subject: [PATCH] Use the primitive "number" type instead of the object counterpart "Number" to avoid a jscompiler error. An upcoming change to J2CL that simplifies how casting logic is transpiled will make the code "(Number) (Object) 3" here transpile to just "/** @type {Number} */ (3)" and jscompiler will see the "invalid cast" since "3" is not "Number" in the closure type system. RELNOTES=n/a ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=225046969 --- .../common/base/super/com/google/common/base/Platform.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Platform.java b/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Platform.java index 58b37b8f59df..db6ce0931768 100644 --- a/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Platform.java +++ b/guava-gwt/src-super/com/google/common/base/super/com/google/common/base/Platform.java @@ -67,7 +67,7 @@ static native String emptyToNull(@Nullable String string) /*-{ return string || null; }-*/; - @JsType(isNative = true, name = "Number", namespace = GLOBAL) + @JsType(isNative = true, name = "number", namespace = GLOBAL) private interface Number { double toPrecision(int precision); }