Not An Array

Test Page for bug in Firebug 1.2.0b3 - 1.2.0b15

// Constructor
function NotAnArray(o) {
	if (o.constructor === Array) {
		this.data = null;
	} else {
		this.data = o;
	}
}

// Add some prototype things
NotAnArray.prototype.toString = function () {
	return 'I\'m not an array!';
};

NotAnArray.prototype.whatAmI = function () {
	return 'Totally not an array.';
};

// Instance
testValue = new NotAnArray('blah');
	

Expected:

I'm not an array! data=blah

Received:

[ ]

Fix:

Error exists in lines 372 - 382 in reps.js.

Existing code is using YUI "YAHOO.lang.isArray" function from YUI 2.2.2.

Updating this function to use the equivalent code from YUI 2.5.1 resolves the issue.

Issue Tracker link

Old reps.js (1.2.0b3)

Patched reps.js (1.2.0b3)

Patched reps.js (1.2.0b4)

Patched reps.js (1.2.0b6)

Patched reps.js (1.2.0b7)

Patched reps.js (1.2.0b13)

Patched reps.js (1.2.0b15)

Patched reps.js (1.2.0)