Hi,
as I couldn't find a QUnit-specific bugtracker, I am posting this here:
When debugging some failing tests, I noticed that the source of an exception lays inside the QUnit.diff method.
The code there is something like (line 1348):
- for (var i in ns) {
- if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
- //...
- }
- }
However, when "Object.prototype" is extended, this piece of code will fail as the name of e.g. the method is enumerated, too.
Example:
- Object.prototype.foo = function() { };
- QUnit.diff("\"TEXT\"", "\"OTHER\"");
causes: "TypeError: Cannot read property 'length' of undefined" when extending Object.prototype.
I was able to fix this bug by adding:
- if (!ns.hasOwnProperty(i))
- continue;
as the first statement in the loop (into line 1349).
I hope you can add this fix to the official source code.
Many thanks for your great library!
Cheers
winSharp93