From 99c9e3f8f96f02f151fc8cb6140b3533bfb4fcad Mon Sep 17 00:00:00 2001 From: Krinkle Date: Mon, 26 Dec 2011 15:04:52 +0000 Subject: [PATCH] Updating jquery.qunit from upstream * Source: https://github.com/jquery/qunit/tree/0aba72f723579082735782231a3503aa249618aa * 1.2.0pre (master/trunk) -> v1.2.0 (release tag) --- resources/jquery/jquery.qunit.css | 2 +- resources/jquery/jquery.qunit.js | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/resources/jquery/jquery.qunit.css b/resources/jquery/jquery.qunit.css index e114ea062b..bcecc4c0da 100644 --- a/resources/jquery/jquery.qunit.css +++ b/resources/jquery/jquery.qunit.css @@ -1,5 +1,5 @@ /** - * QUnit 1.2.0pre - A JavaScript Unit Testing Framework + * QUnit v1.2.0 - A JavaScript Unit Testing Framework * * http://docs.jquery.com/QUnit * diff --git a/resources/jquery/jquery.qunit.js b/resources/jquery/jquery.qunit.js index d630c43d7c..6d2a8a7b8a 100644 --- a/resources/jquery/jquery.qunit.js +++ b/resources/jquery/jquery.qunit.js @@ -1,5 +1,5 @@ /** - * QUnit 1.2.0pre - A JavaScript Unit Testing Framework + * QUnit v1.2.0 - A JavaScript Unit Testing Framework * * http://docs.jquery.com/QUnit * @@ -1065,6 +1065,10 @@ QUnit.equiv = function () { } } + var getProto = Object.getPrototypeOf || function (obj) { + return obj.__proto__; + }; + var callbacks = function () { // for string, boolean, number and null @@ -1154,7 +1158,13 @@ QUnit.equiv = function () { // comparing constructors is more strict than using // instanceof if (a.constructor !== b.constructor) { - return false; + // Allow objects with no prototype to be equivalent to + // objects with Object as their constructor. + if (!((getProto(a) === null && getProto(b) === Object.prototype) || + (getProto(b) === null && getProto(a) === Object.prototype))) + { + return false; + } } // stack constructor before traversing properties -- 2.20.1