diff options
| author | Elliott Sprehn | 2010-11-03 11:47:06 -0700 |
|---|---|---|
| committer | Elliott Sprehn | 2010-11-03 11:47:06 -0700 |
| commit | ee5e881b9ecf87f3fffd43fa00e20fb4233afb4b (patch) | |
| tree | fc9cd0768e76be7159b3c386183fd76fc9c6ed6d /src/JSON.js | |
| parent | 690dfe000bf11fa6b39235d9a177dc79948841d4 (diff) | |
| download | angular.js-ee5e881b9ecf87f3fffd43fa00e20fb4233afb4b.tar.bz2 | |
Fix JSON serialization breakage in WebKit browsers
Diffstat (limited to 'src/JSON.js')
| -rw-r--r-- | src/JSON.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/JSON.js b/src/JSON.js index b2647104..0cbe6b2d 100644 --- a/src/JSON.js +++ b/src/JSON.js @@ -34,7 +34,7 @@ function toJsonArray(buf, obj, pretty, stack){ if (obj === _null) { buf.push($null); } else if (obj instanceof RegExp) { - buf.push(angular['String']['quoteUnicode'](obj.toString())); + buf.push(angular['String']['quoteUnicode'](obj.toString())); } else if (type === $function) { return; } else if (type === $boolean) { @@ -55,7 +55,7 @@ function toJsonArray(buf, obj, pretty, stack){ for(var i=0; i<len; i++) { var item = obj[i]; if (sep) buf.push(","); - if (typeof item == $function || typeof item == $undefined) { + if (!(item instanceof RegExp) && (typeof item == $function || typeof item == $undefined)) { buf.push($null); } else { toJsonArray(buf, item, pretty, stack); |
