Home page Forum Wiki Mail Jabber Devel NIX-FILES

AltLUG Git

Git-repositories of Altai Linux User Group

Improve start()-called-too-often fix, initialize semaphore at 1, fixes autostart...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 1 Oct 2012 10:29:14 +0000 (12:29 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 1 Oct 2012 10:29:14 +0000 (12:29 +0200)
qunit/qunit.js

index a155241..7ca892b 100644 (file)
@@ -369,7 +369,7 @@ QUnit = {
                // 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)" );
+                       QUnit.pushFailure( "Called start() while already started (QUnit.config.semaphore was 0 already)", null, sourceFromStacktrace(2) );
                        return;
                }
                // A slight delay, to avoid any current callbacks
@@ -687,7 +687,7 @@ extend( QUnit, {
                        autorun: false,
                        filter: "",
                        queue: [],
-                       semaphore: 0
+                       semaphore: 1
                });
 
                var tests, banner, result,
@@ -1051,8 +1051,6 @@ QUnit.load = function() {
        }
 
        if ( config.autostart ) {
-               // usually start() throws an error when called while already running (semaphore === 0)
-               QUnit.config.semaphore = 1;
                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