diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/JSON.js | 9 | ||||
| -rw-r--r-- | src/ng/parse.js | 6 |
2 files changed, 3 insertions, 12 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; } diff --git a/src/ng/parse.js b/src/ng/parse.js index 47c5188e..cd60bc83 100644 --- a/src/ng/parse.js +++ b/src/ng/parse.js @@ -752,9 +752,3 @@ function $ParseProvider() { }; }]; } - - -// This is a special access for JSON parser which bypasses the injector -var parseJson = function(json) { - return parser(json, true); -}; |
