Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Push a failing assertion when calling start() while already running. Resets anyway...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 30 Sep 2012 20:39:08 +0000 (22:39 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Sun, 30 Sep 2012 20:39:08 +0000 (22:39 +0200)
qunit/qunit.js

index ef6bdad..b525bdb 100644 (file)
@@ -369,6 +369,8 @@ QUnit = {
                // ignore if start is called more often then stop
                if ( config.semaphore < 0 ) {
                        config.semaphore = 0;
                // ignore if start is called more often then stop
                if ( config.semaphore < 0 ) {
                        config.semaphore = 0;
+                       QUnit.pushFailure( "Called start() while already started (QUnit.config.semaphore was 0 already)" );
+                       return;
                }
                // A slight delay, to avoid any current callbacks
                if ( defined.setTimeout ) {
                }
                // A slight delay, to avoid any current callbacks
                if ( defined.setTimeout ) {
@@ -1048,6 +1050,8 @@ QUnit.load = function() {
        }
 
        if ( config.autostart ) {
        }
 
        if ( config.autostart ) {
+               // usually start() throws an error when called while already running (semaphore === 0)
+               QUnit.config.semaphore = 1;
                QUnit.start();
        }
 };
                QUnit.start();
        }
 };

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