Display the name of the constructor when pretty printing objects

Fixes #598 [finishes #81228592]
This commit is contained in:
slackersoft
2014-12-16 12:56:04 -08:00
parent eca8d8f009
commit 7570bc422b
6 changed files with 39 additions and 35 deletions
+5 -3
View File
@@ -97,13 +97,15 @@ getJasmineRequireObj().pp = function(j$) {
};
StringPrettyPrinter.prototype.emitObject = function(obj) {
var constructorName = obj.constructor ? j$.fnNameFor(obj.constructor) : 'null';
this.append(constructorName);
if (this.ppNestLevel_ > j$.MAX_PRETTY_PRINT_DEPTH) {
this.append('Object');
return;
}
var self = this;
this.append('{ ');
this.append('({ ');
var first = true;
this.iterateObject(obj, function(property, isGetter) {
@@ -122,7 +124,7 @@ getJasmineRequireObj().pp = function(j$) {
}
});
this.append(' }');
this.append(' })');
};
StringPrettyPrinter.prototype.append = function(value) {