[gwt-rpc-plus] r161 committed - Workaround for another busted JSON impl that doesn't turn keys into st...

1 view
Skip to first unread message

gwt-rp...@googlecode.com

unread,
Jun 20, 2010, 10:05:08 PM6/20/10
to dotspots-o...@googlegroups.com
Revision: 161
Author: mmastrac
Date: Sun Jun 20 19:03:31 2010
Log: Workaround for another busted JSON impl that doesn't turn keys into
strings
http://code.google.com/p/gwt-rpc-plus/source/detail?r=161

Modified:

/trunk/gwt-rpc-plus/gwt/com/dotspots/rpcplus/client/codec/impl/NativeJson.java

=======================================
---
/trunk/gwt-rpc-plus/gwt/com/dotspots/rpcplus/client/codec/impl/NativeJson.java
Fri Apr 2 09:36:13 2010
+++
/trunk/gwt-rpc-plus/gwt/com/dotspots/rpcplus/client/codec/impl/NativeJson.java
Sun Jun 20 19:03:31 2010
@@ -14,7 +14,9 @@
public static native boolean isSupported(JavaScriptObject window) /*-{
return ("JSON" in window) && ("stringify" in window.JSON) && ("parse" in
window.JSON)
// Make sure the page isn't using an ancient (circa-2005) version of JSON
- && (window.JSON.stringify([1,,1]) == "[1,null,1]");
+ && (window.JSON.stringify([1,,1]) == "[1,null,1]")
+ // Another busted JSON implementation that doesn't turn keys into strings
+ && (window.JSON.stringify({a:1}) == "{\"a\":1}");
}-*/;

public NativeJson(JavaScriptObject wnd) {

Reply all
Reply to author
Forward
0 new messages