aboutsummaryrefslogtreecommitdiffstats
path: root/src/JSON.js
diff options
context:
space:
mode:
authorIgor Minar2010-08-13 15:14:41 -0700
committerIgor Minar2010-08-13 15:14:41 -0700
commit7159b30752f63ad8a127101cbc10d7e672ae1620 (patch)
treee49e5a6ef6394ec9453e8f89df41c1939cc4bfe9 /src/JSON.js
parent84b3a1774edb1e12ba0076e32fe8928ba54a48e3 (diff)
downloadangular.js-7159b30752f63ad8a127101cbc10d7e672ae1620.tar.bz2
Serialize only own properties to avoid infinite loops when serializing scopes (this)
Diffstat (limited to 'src/JSON.js')
-rw-r--r--src/JSON.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/JSON.js b/src/JSON.js
index 340b075a..0d2fbca4 100644
--- a/src/JSON.js
+++ b/src/JSON.js
@@ -74,7 +74,7 @@ function toJsonArray(buf, obj, pretty, stack){
var childPretty = pretty ? pretty + " " : false;
var keys = [];
for(var k in obj) {
- if (k.indexOf('$$') === 0 || obj[k] === undefined)
+ if (!obj.hasOwnProperty(k) || k.indexOf('$$') === 0 || obj[k] === undefined)
continue;
keys.push(k);
}