mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-04-28 18:34:44 +00:00
Fix JSON serialization breakage in WebKit browsers
This commit is contained in:
parent
690dfe000b
commit
ee5e881b9e
1 changed files with 2 additions and 2 deletions
|
|
@ -34,7 +34,7 @@ function toJsonArray(buf, obj, pretty, stack){
|
||||||
if (obj === _null) {
|
if (obj === _null) {
|
||||||
buf.push($null);
|
buf.push($null);
|
||||||
} else if (obj instanceof RegExp) {
|
} else if (obj instanceof RegExp) {
|
||||||
buf.push(angular['String']['quoteUnicode'](obj.toString()));
|
buf.push(angular['String']['quoteUnicode'](obj.toString()));
|
||||||
} else if (type === $function) {
|
} else if (type === $function) {
|
||||||
return;
|
return;
|
||||||
} else if (type === $boolean) {
|
} else if (type === $boolean) {
|
||||||
|
|
@ -55,7 +55,7 @@ function toJsonArray(buf, obj, pretty, stack){
|
||||||
for(var i=0; i<len; i++) {
|
for(var i=0; i<len; i++) {
|
||||||
var item = obj[i];
|
var item = obj[i];
|
||||||
if (sep) buf.push(",");
|
if (sep) buf.push(",");
|
||||||
if (typeof item == $function || typeof item == $undefined) {
|
if (!(item instanceof RegExp) && (typeof item == $function || typeof item == $undefined)) {
|
||||||
buf.push($null);
|
buf.push($null);
|
||||||
} else {
|
} else {
|
||||||
toJsonArray(buf, item, pretty, stack);
|
toJsonArray(buf, item, pretty, stack);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue