Fix regexp pretty printing for Chrome.
This commit is contained in:
parent
701ee719e6
commit
23c5289b7e
|
@ -29,14 +29,14 @@ jasmine.PrettyPrinter.prototype.format = function(value) {
|
||||||
this.emitString(value);
|
this.emitString(value);
|
||||||
} else if (jasmine.isSpy(value)) {
|
} else if (jasmine.isSpy(value)) {
|
||||||
this.emitScalar("spy on " + value.identity);
|
this.emitScalar("spy on " + value.identity);
|
||||||
|
} else if (value instanceof RegExp) {
|
||||||
|
this.emitScalar(value.toString());
|
||||||
} else if (typeof value === 'function') {
|
} else if (typeof value === 'function') {
|
||||||
this.emitScalar('Function');
|
this.emitScalar('Function');
|
||||||
} else if (typeof value.nodeType === 'number') {
|
} else if (typeof value.nodeType === 'number') {
|
||||||
this.emitScalar('HTMLNode');
|
this.emitScalar('HTMLNode');
|
||||||
} else if (value instanceof Date) {
|
} else if (value instanceof Date) {
|
||||||
this.emitScalar('Date(' + value + ')');
|
this.emitScalar('Date(' + value + ')');
|
||||||
} else if (value instanceof RegExp) {
|
|
||||||
this.emitScalar(value.toString());
|
|
||||||
} else if (value.__Jasmine_been_here_before__) {
|
} else if (value.__Jasmine_been_here_before__) {
|
||||||
this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');
|
this.emitScalar('<circular reference: ' + (jasmine.isArray_(value) ? 'Array' : 'Object') + '>');
|
||||||
} else if (jasmine.isArray_(value) || typeof value == 'object') {
|
} else if (jasmine.isArray_(value) || typeof value == 'object') {
|
||||||
|
|
Loading…
Reference in New Issue