diff options
| author | Misko Hevery | 2011-04-05 11:00:26 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2011-06-08 15:01:32 -0700 | 
| commit | 0e17ade959cc77369dc102d180e43be2af68505a (patch) | |
| tree | 334c001ee00005eb3f67325523feb2afd961fdad /src/JSON.js | |
| parent | bb67ee8d28f2cddb4b503dc8909649994a4d67e1 (diff) | |
| download | angular.js-0e17ade959cc77369dc102d180e43be2af68505a.tar.bz2 | |
Cleanup parser code to expose smaller API
Diffstat (limited to 'src/JSON.js')
| -rw-r--r-- | src/JSON.js | 9 | 
1 files changed, 2 insertions, 7 deletions
diff --git a/src/JSON.js b/src/JSON.js index 186bdb1c..942ce7c0 100644 --- a/src/JSON.js +++ b/src/JSON.js @@ -35,19 +35,14 @@ function toJson(obj, pretty) {  function fromJson(json, useNative) {    if (!isString(json)) return json; -  var obj, p, expression; +  var obj;    try {      if (useNative && window.JSON && window.JSON.parse) {        obj = JSON.parse(json);        return transformDates(obj);      } - -    p = parser(json, true); -    expression =  p.primary(); -    p.assertAllConsumed(); -    return expression(); - +    return parser(json, true).primary()();    } catch (e) {      error("fromJson error: ", json, e);      throw e;  | 
