Skip to content

Commit f165c7d

Browse files
committed
Update vendor/qunit-clib to throw errors for failed tests in ringo, rhino, & narwhal. Also update vendor/requirejs.
1 parent 3cd1b0d commit f165c7d

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

vendor/qunit-clib/qunit-clib.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,20 +173,26 @@
173173
console.log(' Finished in ' + details.runtime + ' milliseconds.');
174174
console.log(hr);
175175

176-
// exit out of Narhwal, Rhino, or RingoJS
177-
try {
178-
quit();
179-
} catch(e) { }
176+
var fails = details.failed,
177+
error = fails + ' of ' + details.total + ' tests failed.';
180178

181179
// exit out of Node.js or PhantomJS
182180
try {
183181
var process = context.process || context.phantom;
184-
if (details.failed) {
185-
console.error('Error: ' + details.failed + ' of ' + details.total + ' tests failed.');
182+
if (fails) {
183+
console.error('Error: ' + error);
186184
process.exit(1);
187185
} else {
188186
process.exit(0);
189187
}
188+
} catch(e) {
189+
if (fails) {
190+
throw new Error(error);
191+
}
192+
}
193+
// exit out of Narhwal, Rhino, or RingoJS
194+
try {
195+
quit();
190196
} catch(e) { }
191197
};
192198
}());

vendor/requirejs/require.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** vim: et:ts=4:sw=4:sts=4
2-
* @license RequireJS 2.1.8 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
2+
* @license RequireJS 2.1.9 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
33
* Available via the MIT or new BSD license.
44
* see: http://github.com/jrburke/requirejs for details
55
*/
@@ -12,7 +12,7 @@ var requirejs, require, define;
1212
(function (global) {
1313
var req, s, head, baseElement, dataMain, src,
1414
interactiveScript, currentlyAddingScript, mainScript, subPath,
15-
version = '2.1.8',
15+
version = '2.1.9',
1616
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
1717
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
1818
jsSuffixRegExp = /\.js$/,
@@ -22,7 +22,7 @@ var requirejs, require, define;
2222
hasOwn = op.hasOwnProperty,
2323
ap = Array.prototype,
2424
apsp = ap.splice,
25-
isBrowser = !!(typeof window !== 'undefined' && navigator && window.document),
25+
isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
2626
isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
2727
//PS3 indicates loaded and complete, but need to wait for complete
2828
//specifically. Sequence is 'loading', 'loaded', execution,
@@ -373,7 +373,6 @@ var requirejs, require, define;
373373
function hasPathFallback(id) {
374374
var pathConfig = getOwn(config.paths, id);
375375
if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
376-
removeScript(id);
377376
//Pop off the first array value, since it failed, and
378377
//retry
379378
pathConfig.shift();
@@ -1464,6 +1463,8 @@ var requirejs, require, define;
14641463
var map = makeModuleMap(id, relMap, true),
14651464
mod = getOwn(registry, id);
14661465

1466+
removeScript(id);
1467+
14671468
delete defined[id];
14681469
delete urlFetched[map.url];
14691470
delete undefEvents[id];
@@ -1609,7 +1610,7 @@ var requirejs, require, define;
16091610

16101611
//Join the path parts together, then figure out if baseUrl is needed.
16111612
url = syms.join('/');
1612-
url += (ext || (/\?/.test(url) || skipExt ? '' : '.js'));
1613+
url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js'));
16131614
url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
16141615
}
16151616

@@ -1918,7 +1919,7 @@ var requirejs, require, define;
19181919
}
19191920

19201921
//Look for a data-main script attribute, which could also adjust the baseUrl.
1921-
if (isBrowser) {
1922+
if (isBrowser && !cfg.skipDataMain) {
19221923
//Figure out baseUrl. Get it from the script tag with require.js in it.
19231924
eachReverse(scripts(), function (script) {
19241925
//Set the 'head' where we can append children by

0 commit comments

Comments
 (0)