Commit d22c5af8 d22c5af8de68dd119abc9d1d480d309b12026767 by Mickaël Andrieu

Modified betterInstanceOf to make weak equality

1 parent 5eeaf0e7
......@@ -80,14 +80,14 @@ exports.betterTypeOf = betterTypeOf;
*/
function betterInstanceOf(input, constructor) {
"use strict";
while (input !== null) {
if (input === constructor.prototype) {
while (input != null) {
if (input == constructor.prototype) {
return true;
}
if (typeof input === 'xml') {
return constructor.prototype === document.prototype;
if (typeof input == 'xml') {
return constructor.prototype == document.prototype;
}
if (typeof input === 'undefined') {
if (typeof input == 'undefined') {
return false;
}
input = input.__proto__;
......