Permalink
Browse files

* Improved $PY.dump() to handle null and undefined

  • Loading branch information...
1 parent a4d0a52 commit 4972c70bf83c534866f289016bc1e7667f1eb445 Christian Iversen committed Jan 16, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 pyjaco/stdlib/06-pyjaco.js
View
@@ -60,12 +60,12 @@ $PY.dump = function(obj) {
res.push(i + " (number: " + val + ")");
} else if (typeof val === 'string') {
res.push(i + " (string: " + val + ")");
- } else if (typeof val === '') {
- res.push(i + " ()");
- } else if (typeof val === '') {
- res.push(i + " ()");
- } else if (typeof val === '') {
- res.push(i + " ()");
+ } else if (val === null) {
+ res.push(i + " (null)");
+ } else if (val === undefined) {
+ res.push(i + " (undefined)");
+ } else {
+ res.push(i + " (object)");
}
}
res.sort();

0 comments on commit 4972c70

Please sign in to comment.