Bug 682758 - Stop repr() trying to call match() on an empty Array. r=mdas

This commit is contained in:
Matt Woodrow 2011-09-01 11:35:04 +12:00
parent 645ee9b6d4
commit f41ce961ab

View File

@ -33,8 +33,6 @@ if (parentRunner) {
}
/* Helper functions pulled out of various MochiKit modules */
var reprRegistry = [];
if (typeof(repr) == 'undefined') {
function repr(o) {
if (typeof(o) == "undefined") {
@ -48,17 +46,16 @@ if (typeof(repr) == 'undefined') {
} else if (typeof(o.repr) == 'function' && o.repr != arguments.callee) {
return o.repr();
}
return reprRegistry.match(o);
} catch (e) {
try {
if (typeof(o.NAME) == 'string' && (
o.toString == Function.prototype.toString ||
o.toString == Object.prototype.toString
)) {
return o.NAME;
}
} catch (e) {
} catch (e) {
}
try {
if (typeof(o.NAME) == 'string' && (
o.toString == Function.prototype.toString ||
o.toString == Object.prototype.toString
)) {
return o.NAME;
}
} catch (e) {
}
try {
var ostring = (o + "");