From e7e96eb8afc196d608e0c4a8231f10a3047c49f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 25 Aug 2015 17:36:24 +0200 Subject: [PATCH] fix the run-qunit scripts with backward compatible syntax --- lib/autospec/run-qunit.js | 12 ++++++++---- vendor/assets/javascripts/run-qunit.js | 7 +++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/autospec/run-qunit.js b/lib/autospec/run-qunit.js index 2200aac6236..a4a851822e1 100644 --- a/lib/autospec/run-qunit.js +++ b/lib/autospec/run-qunit.js @@ -1,11 +1,15 @@ /*jshint devel:true, phantom:true */ -/*global QUnit, ANSI */ +/*globals QUnit ANSI */ + // THIS FILE IS CALLED BY "qunit_runner.rb" IN AUTOSPEC -var system = require('system'), - args = system.args; +var system = require("system"), + args = phantom.args; -args.shift(); +if (args === undefined) { + args = system.args; + args.shift(); +} if (args.length !== 1) { console.log("Usage: " + phantom.scriptName + " "); diff --git a/vendor/assets/javascripts/run-qunit.js b/vendor/assets/javascripts/run-qunit.js index 2d707294865..f2bca495325 100644 --- a/vendor/assets/javascripts/run-qunit.js +++ b/vendor/assets/javascripts/run-qunit.js @@ -3,9 +3,12 @@ /*globals QUnit phantom*/ var system = require("system"), - args = system.args; + args = phantom.args; -args.shift(); +if (args === undefined) { + args = system.args; + args.shift(); +} if (args.length < 1 || args.length > 2) { console.log("Usage: " + phantom.scriptName + " ");