1
1
/**
2
- * @license r.js 2.1.6+ Sun, 07 Jul 2013 05 :44:10 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
2
+ * @license r.js 2.1.6+ Sun, 07 Jul 2013 23 :44:07 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, xpcUtil;
20
20
(function (console, args, readFileFunc) {
21
21
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
22
22
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
23
- version = '2.1.6+ Sun, 07 Jul 2013 05 :44:10 GMT',
23
+ version = '2.1.6+ Sun, 07 Jul 2013 23 :44:07 GMT',
24
24
jsSuffixRegExp = /\.js$/,
25
25
commandOption = '',
26
26
useLibLoaded = {},
@@ -24627,7 +24627,8 @@ define('build', function (require) {
24627
24627
' correctly while running in the optimizer. Try only' +
24628
24628
' using a config that is also valid JSON, or do not use' +
24629
24629
' mainConfigFile and instead copy the config values needed' +
24630
- ' into a build file or command line arguments given to the optimizer.');
24630
+ ' into a build file or command line arguments given to the optimizer.\n' +
24631
+ 'Source error from parsing: ' + mainConfigFile + ': ' + configError);
24631
24632
}
24632
24633
if (mainConfig) {
24633
24634
mainConfigPath = mainConfigFile.substring(0, mainConfigFile.lastIndexOf('/'));
@@ -24722,10 +24723,21 @@ define('build', function (require) {
24722
24723
' for optimization, and "dir" if you want the appDir' +
24723
24724
' or baseUrl directories optimized.');
24724
24725
}
24725
- if (config.dir && config.appDir && config.dir === config.appDir) {
24726
- throw new Error('"dir" and "appDir" set to the same directory.' +
24727
- ' This could result in the deletion of appDir.' +
24728
- ' Stopping.');
24726
+
24727
+ if (config.dir) {
24728
+ // Make sure the output dir is not set to a parent of the
24729
+ // source dir or the same dir, as it will result in source
24730
+ // code deletion.
24731
+ if (config.dir === config.baseUrl ||
24732
+ config.dir === config.appDir ||
24733
+ (config.baseUrl && build.makeRelativeFilePath(config.dir,
24734
+ config.baseUrl).indexOf('..') !== 0) ||
24735
+ (config.appDir &&
24736
+ build.makeRelativeFilePath(config.dir, config.appDir).indexOf('..') !== 0)) {
24737
+ throw new Error('"dir" is set to a parent or same directory as' +
24738
+ ' "appDir" or "baseUrl". This can result in' +
24739
+ ' the deletion of source code. Stopping.');
24740
+ }
24729
24741
}
24730
24742
24731
24743
if (config.insertRequire && !lang.isArray(config.insertRequire)) {
0 commit comments