Skip to content

Commit 2afb402

Browse files
committed
snapshot
1 parent 8a6c946 commit 2afb402

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

build/example.build.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848

4949
//Configure CommonJS packages. See http://requirejs.org/docs/api.html#packages
5050
//for more information.
51-
packagePaths: [],
5251
packages: [],
5352

5453
//The directory path to save the output. If not specified, then

dist/r.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license r.js 2.1.1+ Tue, 20 Nov 2012 20:29:53 GMT Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
2+
* @license r.js 2.1.1+ Wed, 21 Nov 2012 21:49:04 GMT 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
*/
@@ -21,7 +21,7 @@ var requirejs, require, define;
2121

2222
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2323
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode,
24-
version = '2.1.1+ Tue, 20 Nov 2012 20:29:53 GMT',
24+
version = '2.1.1+ Wed, 21 Nov 2012 21:49:04 GMT',
2525
jsSuffixRegExp = /\.js$/,
2626
commandOption = '',
2727
useLibLoaded = {},
@@ -1133,6 +1133,11 @@ var requirejs, require, define;
11331133
//it.
11341134
getModule(moduleMap);
11351135

1136+
//Transfer any config to this other module.
1137+
if (hasProp(config.config, id)) {
1138+
config.config[moduleName] = config.config[id];
1139+
}
1140+
11361141
try {
11371142
req.exec(text);
11381143
} catch (e) {
@@ -1254,7 +1259,10 @@ var requirejs, require, define;
12541259
};
12551260

12561261
function callGetModule(args) {
1257-
getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
1262+
//Skip modules already defined.
1263+
if (!hasProp(defined, args[0])) {
1264+
getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
1265+
}
12581266
}
12591267

12601268
function removeListener(node, func, name, ieName) {
@@ -20569,7 +20577,8 @@ define('rhino/optimize', ['logger', 'env!env/file'], function (logger, file) {
2056920577
};
2057020578
}
2057120579

20572-
var JSSourceFilefromCode, optimize;
20580+
var JSSourceFilefromCode, optimize,
20581+
mapRegExp = /"file":"[^"]+"/;
2057320582

2057420583
//Bind to Closure compiler, but if it is not available, do not sweat it.
2057520584
try {
@@ -20605,6 +20614,7 @@ define('rhino/optimize', ['logger', 'env!env/file'], function (logger, file) {
2060520614
closure: function (fileName, fileContents, outFileName, keepLines, config) {
2060620615
config = config || {};
2060720616
var result, mappings, optimized, compressed, baseName, writer,
20617+
outBaseName, outFileNameMap, outFileNameMapContent,
2060820618
jscomp = Packages.com.google.javascript.jscomp,
2060920619
flags = Packages.com.google.common.flags,
2061020620
//Fake extern
@@ -20649,15 +20659,22 @@ define('rhino/optimize', ['logger', 'env!env/file'], function (logger, file) {
2064920659
optimized = String(compiler.toSource());
2065020660

2065120661
if (config.generateSourceMaps && result.sourceMap && outFileName) {
20652-
baseName = (new java.io.File(outFileName)).getName();
20662+
outBaseName = (new java.io.File(outFileName)).getName();
2065320663

2065420664
file.saveUtf8File(outFileName + ".src", fileContents);
2065520665

20656-
writer = getFileWriter(outFileName + ".map", "utf-8");
20666+
outFileNameMap = outFileName + ".map";
20667+
writer = getFileWriter(outFileNameMap, "utf-8");
2065720668
result.sourceMap.appendTo(writer, outFileName);
2065820669
writer.close();
2065920670

20660-
fileContents = optimized + "\n//@ sourceMappingURL=" + baseName + ".map";
20671+
//Not sure how better to do this, but right now the .map file
20672+
//leaks the full OS path in the "file" property. Manually
20673+
//modify it to not do that.
20674+
file.saveFile(outFileNameMap,
20675+
file.readFile(outFileNameMap).replace(mapRegExp, '"file":"' + baseName + '"'));
20676+
20677+
fileContents = optimized + "\n//@ sourceMappingURL=" + outBaseName + ".map";
2066120678
} else {
2066220679
fileContents = optimized;
2066320680
}

require.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,11 @@ var requirejs, require, define;
10091009
//it.
10101010
getModule(moduleMap);
10111011

1012+
//Transfer any config to this other module.
1013+
if (hasProp(config.config, id)) {
1014+
config.config[moduleName] = config.config[id];
1015+
}
1016+
10121017
try {
10131018
req.exec(text);
10141019
} catch (e) {
@@ -1130,7 +1135,10 @@ var requirejs, require, define;
11301135
};
11311136

11321137
function callGetModule(args) {
1133-
getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
1138+
//Skip modules already defined.
1139+
if (!hasProp(defined, args[0])) {
1140+
getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
1141+
}
11341142
}
11351143

11361144
function removeListener(node, func, name, ieName) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy