Rebuild distribution
This commit is contained in:
@@ -224,6 +224,16 @@ getJasmineRequireObj().util = function() {
|
||||
return obj === void 0;
|
||||
};
|
||||
|
||||
util.arrayContains = function(array, search) {
|
||||
var i = array.length;
|
||||
while (i--) {
|
||||
if (array[i] == search) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
return util;
|
||||
};
|
||||
|
||||
@@ -1407,6 +1417,7 @@ getJasmineRequireObj().pp = function(j$) {
|
||||
|
||||
function PrettyPrinter() {
|
||||
this.ppNestLevel_ = 0;
|
||||
this.seen = [];
|
||||
}
|
||||
|
||||
PrettyPrinter.prototype.format = function(value) {
|
||||
@@ -1434,16 +1445,16 @@ getJasmineRequireObj().pp = function(j$) {
|
||||
this.emitScalar('HTMLNode');
|
||||
} else if (value instanceof Date) {
|
||||
this.emitScalar('Date(' + value + ')');
|
||||
} else if (value.__Jasmine_been_here_before__) {
|
||||
} 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)) {
|
||||
value.__Jasmine_been_here_before__ = true;
|
||||
this.seen.push(value);
|
||||
if (j$.isArray_(value)) {
|
||||
this.emitArray(value);
|
||||
} else {
|
||||
this.emitObject(value);
|
||||
}
|
||||
delete value.__Jasmine_been_here_before__;
|
||||
this.seen.pop();
|
||||
} else {
|
||||
this.emitScalar(value.toString());
|
||||
}
|
||||
@@ -1455,7 +1466,6 @@ getJasmineRequireObj().pp = function(j$) {
|
||||
PrettyPrinter.prototype.iterateObject = function(obj, fn) {
|
||||
for (var property in obj) {
|
||||
if (!Object.prototype.hasOwnProperty.call(obj, property)) { continue; }
|
||||
if (property == '__Jasmine_been_here_before__') { continue; }
|
||||
fn(property, obj.__lookupGetter__ ? (!j$.util.isUndefined(obj.__lookupGetter__(property)) &&
|
||||
obj.__lookupGetter__(property) !== null) : false);
|
||||
}
|
||||
@@ -1516,7 +1526,7 @@ getJasmineRequireObj().pp = function(j$) {
|
||||
}
|
||||
|
||||
self.append(property);
|
||||
self.append(' : ');
|
||||
self.append(': ');
|
||||
if (isGetter) {
|
||||
self.append('<getter>');
|
||||
} else {
|
||||
|
||||
@@ -38,7 +38,7 @@ getJasmineRequireObj().util = function() {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
return util;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user