Merge branch 'toString_fallback' of https://github.com/myitcv/jasmine into myitcv-toString_fallback

This commit is contained in:
Gregg Van Hove
2015-10-04 13:46:59 -07:00
3 changed files with 12 additions and 0 deletions

View File

@@ -30,6 +30,8 @@ getJasmineRequireObj().pp = function(j$) {
this.emitScalar('HTMLNode');
} else if (value instanceof Date) {
this.emitScalar('Date(' + value + ')');
} else if (value.toString && typeof value === 'object' && !(value instanceof Array) && value.toString !== Object.prototype.toString) {
this.emitScalar(value.toString());
} else if (j$.util.arrayContains(this.seen, value)) {
this.emitScalar('<circular reference: ' + (j$.isArray_(value) ? 'Array' : 'Object') + '>');
} else if (j$.isArray_(value) || j$.isA_('Object', value)) {