Permalink
Browse files

fix for undefined fields

  • Loading branch information...
substack committed Nov 10, 2011
1 parent 4c5b169 commit 66065250a99b840a36a6bcc050fd3698d79ab179
Showing with 4 additions and 1 deletion.
  1. +3 −0 index.js
  2. +1 −1 test/undef.js
View
@@ -93,6 +93,9 @@ function split (obj) {
parts.push(node);
this.block();
}
+ else if (node === null || node === undefined) {
+ s += 'null';
+ }
else if (Array.isArray(node)) {
this.before(function () { s += '[' });
this.post(function (child) {
View
@@ -18,7 +18,7 @@ test('undef', function (t) {
s.on('end', function () {
t.deepEqual(JSON.parse(data), {
a : 3,
- b : undefined,
+ b : null,
c : null
});
});

0 comments on commit 6606525

Please sign in to comment.