aboutsummaryrefslogtreecommitdiffstats
path: root/src/JSON.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/JSON.js')
-rw-r--r--src/JSON.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/JSON.js b/src/JSON.js
index 3d329aa5..186bdb1c 100644
--- a/src/JSON.js
+++ b/src/JSON.js
@@ -128,9 +128,9 @@ function toJsonArray(buf, obj, pretty, stack) {
var childPretty = pretty ? pretty + " " : false;
var keys = [];
for(var k in obj) {
- if (obj[k] === undefined)
- continue;
- keys.push(k);
+ if (obj.hasOwnProperty(k) && obj[k] !== undefined) {
+ keys.push(k);
+ }
}
keys.sort();
for ( var keyIndex = 0; keyIndex < keys.length; keyIndex++) {