Updating jquery.qunit from upstream
authorKrinkle <krinkle@users.mediawiki.org>
Mon, 26 Dec 2011 15:04:52 +0000 (15:04 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Mon, 26 Dec 2011 15:04:52 +0000 (15:04 +0000)
* Source: https://github.com/jquery/qunit/tree/0aba72f723579082735782231a3503aa249618aa
* 1.2.0pre (master/trunk) -> v1.2.0 (release tag)

resources/jquery/jquery.qunit.css
resources/jquery/jquery.qunit.js

index e114ea0..bcecc4c 100644 (file)
@@ -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
  *
index d630c43..6d2a8a7 100644 (file)
@@ -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