Workaround JSONTest failure in Firefox 17
For some reason, calling JSONValue.isNull() sometimes returns non-null
even for JSONArray, JSONBoolean, and JSONObject values. This only
happens in Firefox 17 in web, draft, or nometa test modes, not in dev
mode.
As a workaround, since JSONNull is a singleton class, return null in
JSONNull.isNull() if 'this' doesn't refer to the singleton instance.
Bug: issue 8139
Change-Id: I8c79c5279a122748047b23d068e2eed4ad9fb22f
diff --git a/user/src/com/google/gwt/json/client/JSONNull.java b/user/src/com/google/gwt/json/client/JSONNull.java
index 8da5c87..b3b1e61 100644
--- a/user/src/com/google/gwt/json/client/JSONNull.java
+++ b/user/src/com/google/gwt/json/client/JSONNull.java
@@ -49,6 +49,10 @@
*/
@Override
public JSONNull isNull() {
+ // Workaround for https://code.google.com/p/google-web-toolkit/issues/detail?id=8139
+ if (this != instance) {
+ return null;
+ }
return this;
}