(value)
| 6619 | } |
| 6620 | |
| 6621 | format(value) { |
| 6622 | this.ppNestLevel_++ |
| 6623 | try { |
| 6624 | const customFormatResult = this.applyCustomFormatters_(value) |
| 6625 | |
| 6626 | if (customFormatResult) { |
| 6627 | this.emitScalar(customFormatResult) |
| 6628 | } else if (j$.util.isUndefined(value)) { |
| 6629 | this.emitScalar("undefined") |
| 6630 | } else if (value === null) { |
| 6631 | this.emitScalar("null") |
| 6632 | } else if (value === 0 && 1 / value === -Infinity) { |
| 6633 | this.emitScalar("-0") |
| 6634 | } else if (value === j$.getGlobal()) { |
| 6635 | this.emitScalar("<global>") |
| 6636 | } else if (value.jasmineToString) { |
| 6637 | this.emitScalar(value.jasmineToString(this.pp_)) |
| 6638 | } else if (j$.isString_(value)) { |
| 6639 | this.emitString(value) |
| 6640 | } else if (j$.isSpy(value)) { |
| 6641 | this.emitScalar("spy on " + value.and.identity) |
| 6642 | } else if (j$.isSpy(value.toString)) { |
| 6643 | this.emitScalar("spy on " + value.toString.and.identity) |
| 6644 | } else if (value instanceof RegExp) { |
| 6645 | this.emitScalar(value.toString()) |
| 6646 | } else if (typeof value === "function") { |
| 6647 | this.emitScalar("Function") |
| 6648 | } else if (j$.isDomNode(value)) { |
| 6649 | if (value.tagName) { |
| 6650 | this.emitDomElement(value) |
| 6651 | } else { |
| 6652 | this.emitScalar("HTMLNode") |
| 6653 | } |
| 6654 | } else if (value instanceof Date) { |
| 6655 | this.emitScalar("Date(" + value + ")") |
| 6656 | } else if (j$.isSet(value)) { |
| 6657 | this.emitSet(value) |
| 6658 | } else if (j$.isMap(value)) { |
| 6659 | this.emitMap(value) |
| 6660 | } else if (j$.isTypedArray_(value)) { |
| 6661 | this.emitTypedArray(value) |
| 6662 | } else if ( |
| 6663 | value.toString && |
| 6664 | typeof value === "object" && |
| 6665 | !j$.isArray_(value) && |
| 6666 | hasCustomToString(value) |
| 6667 | ) { |
| 6668 | try { |
| 6669 | this.emitScalar(value.toString()) |
| 6670 | } catch (e) { |
| 6671 | this.emitScalar("has-invalid-toString-method") |
| 6672 | } |
| 6673 | } else if (this.seen.includes(value)) { |
| 6674 | this.emitScalar("<circular reference: " + (j$.isArray_(value) ? "Array" : "Object") + ">") |
| 6675 | } else if (j$.isArray_(value) || j$.isA_("Object", value)) { |
| 6676 | this.seen.push(value) |
| 6677 | if (j$.isArray_(value)) { |
| 6678 | this.emitArray(value) |
no test coverage detected