1
0
Fork 0

Handle Object.create(null).

This commit is contained in:
Alan Plum 2014-07-23 16:29:48 +02:00
parent 80070b9e83
commit e7e9ec33c5
1 changed files with 3 additions and 3 deletions

View File

@ -1100,12 +1100,12 @@
context.output += context.names[p];
}
else {
if (value instanceof Object) {
if (value instanceof Object || value.__proto__ === null) {
context.seen.push(value);
context.names.push(context.path);
}
if (value instanceof Object) {
if (value instanceof Object || value.__proto__ === null) {
if (customInspect && typeof value._PRINT === "function") {
value._PRINT(context);
@ -1117,7 +1117,7 @@
else if (value instanceof Array) {
printArray(value, context);
}
else if (value.toString === Object.prototype.toString) {
else if (value.toString === Object.prototype.toString || value.__proto__ === null) {
printObject(value, context);
if (context.emit && context.output.length >= context.emit) {