Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Merge remote branch 'wwalser/recursionBug'
[qunit.git] / qunit / qunit.js
index 49db755..7724b9a 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * QUnit - A JavaScript Unit Testing Framework
+ * QUnit 1.1.0pre - A JavaScript Unit Testing Framework
  *
  * http://docs.jquery.com/QUnit
  *
@@ -21,7 +21,9 @@ var defined = {
        })()
 };
 
-var testId = 0;
+var    testId = 0,
+       toString = Object.prototype.toString,
+       hasOwn = Object.prototype.hasOwnProperty;
 
 var Test = function(name, testName, expected, testEnvironmentArg, async, callback) {
        this.name = name;
@@ -125,7 +127,7 @@ Test.prototype = {
        },
        finish: function() {
                config.current = this;
-               if ( this.expected && this.expected != this.assertions.length ) {
+               if ( this.expected != null && this.expected != this.assertions.length ) {
                        QUnit.ok( false, "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
                }
 
@@ -265,7 +267,7 @@ var QUnit = {
        asyncTest: function(testName, expected, callback) {
                if ( arguments.length === 2 ) {
                        callback = expected;
-                       expected = 0;
+                       expected = null;
                }
 
                QUnit.test(testName, expected, callback, true);
@@ -610,8 +612,7 @@ extend(QUnit, {
                                return "null";
                }
 
-               var type = Object.prototype.toString.call( obj )
-                       .match(/^\[object\s(.*)\]$/)[1] || '';
+               var type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || '';
 
                switch (type) {
                                case 'Number':
@@ -673,6 +674,9 @@ extend(QUnit, {
                var querystring = "?",
                        key;
                for ( key in params ) {
+                       if ( !hasOwn.call( params, key ) ) {
+                               continue;
+                       }
                        querystring += encodeURIComponent( key ) + "=" +
                                encodeURIComponent( params[ key ] ) + "&";
                }
@@ -930,6 +934,9 @@ function saveGlobal() {
 
        if ( config.noglobals ) {
                for ( var key in window ) {
+                       if ( !hasOwn.call( window, key ) ) {
+                               continue;
+                       }
                        config.pollution.push( key );
                }
        }
@@ -1455,6 +1462,9 @@ QUnit.diff = (function() {
                }
 
                for (var i in ns) {
+                       if ( !hasOwn.call( ns, i ) ) {
+                               continue;
+                       }
                        if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
                                n[ns[i].rows[0]] = {
                                        text: n[ns[i].rows[0]],

Hosting is provided AltSPAHow to use Git
Please direct any questions on jabber alex.wolf@jabber.ru

Valid HTML 4.0 Transitional Valid CSS!

Designer Alexander Wolf