diff options
Diffstat (limited to 'src/JSON.js')
| -rw-r--r-- | src/JSON.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/JSON.js b/src/JSON.js index cddfc52d..bcb5fabe 100644 --- a/src/JSON.js +++ b/src/JSON.js @@ -27,15 +27,12 @@ function toJson(obj, pretty) { * Deserializes a JSON string. * * @param {string} json JSON string to deserialize. - * @param {boolean} [useNative=false] Use native JSON parser, if available. * @returns {Object|Array|Date|string|number} Deserialized thingy. */ -function fromJson(json, useNative) { - if (!isString(json)) return json; - - return (useNative && window.JSON && window.JSON.parse) +function fromJson(json) { + return isString(json) ? JSON.parse(json) - : parseJson(json, true)(); + : json; } |
