Revision: 7063 Author: rice+leg...@google.com Date: Fri Nov 20 09:21:21 2009 Log: Simplify FF workaround for 'hasOwnProperty' String keys (missed a file the first time)
Review by: scottb http://code.google.com/p/google-web-toolkit/source/detail?r=7063 Modified: /trunk/user/src/com/google/gwt/json/client/JSONObject.java ======================================= --- /trunk/user/src/com/google/gwt/json/client/JSONObject.java Thu Nov 19 14:22:49 2009 +++ /trunk/user/src/com/google/gwt/json/client/JSONObject.java Fri Nov 20 09:21:21 2009 @@ -236,11 +236,9 @@ private native JSONValue get0(String key) /*-{ var jsObject = th...@com.google.gwt.json.client.jsonobject::jsObject; var v; - // In Firefox, jsObject.hasOwnProperty(key) fails when key is - // a String object rather than a primitive string. - if (jsObject.hasOwnProperty(key) - || ((typeof key == 'object') && (key.constructor == String) - && jsObject.hasOwnProperty(key.toString()))) { + // In Firefox, jsObject.hasOwnProperty(key) requires a primitive string + key = String(key); + if (jsObject.hasOwnProperty(key)) { v = jsObject[key]; } var func = @com.google.gwt.json.client.JSONParser::typeMap[typeof v]; -- http://groups.google.com/group/Google-Web-Toolkit-Contributors