}\r
\r
public final String toJsonString() {\r
- String ret = "";\r
+ // In dev-mode a null object casted to JavascriptObject does not throw a NPE\r
+ // e.g: System.out.println(((Properties)null).toJsonString());\r
+ if (this == null) return "null";\r
\r
+ String ret = "";\r
for (String k : keys()){\r
String ky = k.matches("\\d+") ? k : "\"" + k + "\"";\r
JsCache o = getArray(k).cast();\r
}\r
ret += "],";\r
} else {\r
+ System.out.println("N");\r
Properties p = getJavaScriptObject(k);\r
if (p != null) {\r
ret += ky + ":" + p.toJsonString() + ",";\r
}\r
\r
public final String toQueryString() {\r
+ // In dev-mode a null object casted to JavascriptObject does not throw a NPE\r
+ if (this == null) return "null";\r
+ \r
String ret = "";\r
for (String k : keys()) {\r
ret += ret.isEmpty() ? "" : "&";\r