1
1
/**
2
- * @license r.js 2.0.2+ Mon, 18 Jun 2012 17:33:16 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
2
+ * @license r.js 2.0.2+ Mon, 18 Jun 2012 20:53:28 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.2+ Mon, 18 Jun 2012 17:33:16 GMT',
23
+ version = '2.0.2+ Mon, 18 Jun 2012 20:53:28 GMT',
24
24
jsSuffixRegExp = /\.js$/,
25
25
commandOption = '',
26
26
useLibLoaded = {},
@@ -2021,21 +2021,21 @@ var requirejs, require, define;
2021
2021
//baseUrl, if it is not already set.
2022
2022
dataMain = script.getAttribute('data-main');
2023
2023
if (dataMain) {
2024
-
2025
- //Pull off the directory of data-main for use as the
2026
- //baseUrl.
2027
- src = dataMain.split('/');
2028
- mainScript = src.pop();
2029
- subPath = src.length ? src.join('/') + '/' : './';
2030
-
2031
2024
//Set final baseUrl if there is not already an explicit one.
2032
2025
if (!cfg.baseUrl) {
2026
+ //Pull off the directory of data-main for use as the
2027
+ //baseUrl.
2028
+ src = dataMain.split('/');
2029
+ mainScript = src.pop();
2030
+ subPath = src.length ? src.join('/') + '/' : './';
2031
+
2033
2032
cfg.baseUrl = subPath;
2033
+ dataMain = mainScript;
2034
2034
}
2035
2035
2036
2036
//Strip off any trailing .js since dataMain is now
2037
2037
//like a module name.
2038
- dataMain = mainScript .replace(jsSuffixRegExp, '');
2038
+ dataMain = dataMain .replace(jsSuffixRegExp, '');
2039
2039
2040
2040
//Put the data-main script in the files to load.
2041
2041
cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain];
@@ -3135,12 +3135,14 @@ if(env === 'node') {
3135
3135
* see: http://github.com/jrburke/requirejs for details
3136
3136
*/
3137
3137
3138
- /*jslint strict: false */
3139
- /*global define: false, console: false */
3138
+ /*jslint */
3139
+ /*global define, process */
3140
3140
3141
- define('node/print', function () {
3141
+ define('node/print', ['fs'], function (fs) {
3142
+ 'use strict';
3142
3143
function print(msg) {
3143
- console.log(msg);
3144
+ fs.writeSync(process.stdout.fd, msg + '\n');
3145
+ fs.fsyncSync(process.stdout.fd);
3144
3146
}
3145
3147
3146
3148
return print;
0 commit comments