Skip to content

Commit 722b244

Browse files
committed
inspect: Handle 'null' properly
1 parent 607f11c commit 722b244

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

docs/parse.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ function inspect(object) {
8484
function _inspect(root, object, depth, stack) {
8585
switch (typeof object) {
8686
case 'object':
87+
case 'null': // ES 5.1
88+
if (!object) {
89+
//null
90+
root.appendChild(document.createTextNode('null'));
91+
break;
92+
}
93+
8794
var level = stack.indexOf(object);
8895
if (level !== -1) {
8996
root.appendChild(document.createTextNode(buildPath(depth - level)));

0 commit comments

Comments
 (0)