diff options
| author | Misko Hevery | 2010-01-11 17:32:33 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2010-01-11 17:32:33 -0800 | 
| commit | 6d5471c9bea9671dec7900a7bc548aea8ddd5a3e (patch) | |
| tree | 23a0affaa4b977b0eb776f515bd27eda89431049 /src/JSON.js | |
| parent | 1a42a3fab99ca02af0476f5a87175c53104aa2e3 (diff) | |
| download | angular.js-6d5471c9bea9671dec7900a7bc548aea8ddd5a3e.tar.bz2 | |
all files converted to prototype= {}
Diffstat (limited to 'src/JSON.js')
| -rw-r--r-- | src/JSON.js | 10 | 
1 files changed, 6 insertions, 4 deletions
| diff --git a/src/JSON.js b/src/JSON.js index 14fce1fb..0c842865 100644 --- a/src/JSON.js +++ b/src/JSON.js @@ -1,16 +1,16 @@  array = [].constructor; -toJson = function(obj, pretty){ +function toJson(obj, pretty){    var buf = [];    toJsonArray(buf, obj, pretty ? "\n  " : null);    return buf.join('');  }; -toPrettyJson = function(obj) { +function toPrettyJson(obj)  {    return toJson(obj, true);  }; -fromJson = function(json) { +function fromJson(json) {    try {      var parser = new Parser(json, true);      var expression =  parser.primary(); @@ -22,8 +22,10 @@ fromJson = function(json) {    }  }; +angular['toJson'] = toJson; +angular['fromJson'] = fromJson; -toJsonArray = function(buf, obj, pretty){ +function toJsonArray(buf, obj, pretty){    var type = typeof obj;    if (obj === null) {      buf.push("null"); | 
