1
1
/**
2
- * @license r.js 2.0.1+ Sat, 09 Jun 2012 05:20:58 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
2
+ * @license r.js 2.0.1+ Sat, 09 Jun 2012 18:38:26 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
3
3
* Available via the MIT or new BSD license.
4
4
* see: http://github.com/jrburke/requirejs for details
5
5
*/
@@ -20,7 +20,7 @@ var requirejs, require, define;
20
20
21
21
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
22
22
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode,
23
- version = '2.0.1+ Sat, 09 Jun 2012 05:20:58 GMT',
23
+ version = '2.0.1+ Sat, 09 Jun 2012 18:38:26 GMT',
24
24
jsSuffixRegExp = /\.js$/,
25
25
commandOption = '',
26
26
useLibLoaded = {},
@@ -16312,7 +16312,11 @@ function (lang, logger, file, parse, optimize, pragma,
16312
16312
errMessage = '',
16313
16313
failedPluginMap = {},
16314
16314
failedPluginIds = [],
16315
- errIds = [];
16315
+ errIds = [],
16316
+ errUrlMap = {},
16317
+ errUrlConflicts = {},
16318
+ hasErrUrl = false,
16319
+ errUrl, prop;
16316
16320
16317
16321
//Reset some state set up in requirePatch.js, and clean up require's
16318
16322
//current context.
@@ -16358,6 +16362,21 @@ function (lang, logger, file, parse, optimize, pragma,
16358
16362
if (registry.hasOwnProperty(id) && id.indexOf('_@r') !== 0) {
16359
16363
if (id.indexOf('_unnormalized') === -1) {
16360
16364
errIds.push(id);
16365
+ errUrl = registry[id].map.url;
16366
+
16367
+ if (errUrlMap[errUrl]) {
16368
+ hasErrUrl = true;
16369
+ //This error module has the same URL as another
16370
+ //error module, could be misconfiguration.
16371
+ if (!errUrlConflicts[errUrl]) {
16372
+ errUrlConflicts[errUrl] = [];
16373
+ //Store the original module that had the same URL.
16374
+ errUrlConflicts[errUrl].push(errUrlMap[errUrl]);
16375
+ }
16376
+ errUrlConflicts[errUrl].push(id);
16377
+ } else {
16378
+ errUrlMap[errUrl] = id;
16379
+ }
16361
16380
}
16362
16381
16363
16382
//Look for plugins that did not call load()
@@ -16379,6 +16398,18 @@ function (lang, logger, file, parse, optimize, pragma,
16379
16398
failedPluginIds.join(', ') + '\n';
16380
16399
}
16381
16400
errMessage += 'Module loading did not complete for: ' + errIds.join(', ');
16401
+
16402
+ if (hasErrUrl) {
16403
+ errMessage += '\nThe following modules share the same URL. This ' +
16404
+ 'could be a misconfiguration if that URL only has ' +
16405
+ 'one anonymous module in it:';
16406
+ for (prop in errUrlConflicts) {
16407
+ if (errUrlConflicts.hasOwnProperty(prop)) {
16408
+ errMessage += '\n' + prop + ': ' +
16409
+ errUrlConflicts[prop].join(', ');
16410
+ }
16411
+ }
16412
+ }
16382
16413
throw new Error(errMessage);
16383
16414
}
16384
16415
0 commit comments