Rebuild distribution

This commit is contained in:
Greg Cobb and Luan Santos
2014-03-12 11:51:49 -07:00
parent 21de44a204
commit 367d3dcf66
2 changed files with 16 additions and 6 deletions

View File

@@ -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 {

View File

@@ -38,7 +38,7 @@ getJasmineRequireObj().util = function() {
}
}
return false;
}
};
return util;
};