Skip to content

Commit c59b169

Browse files
committed
Updating for 1.0.4 release.
1 parent e18c32c commit c59b169

File tree

4 files changed

+68
-32
lines changed

4 files changed

+68
-32
lines changed

build/jslib/x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license r.js 1.0.3+ Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
2+
* @license r.js 1.0.4 Copyright (c) 2010-2011, 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
*/
@@ -20,7 +20,7 @@ var requirejs, require, define;
2020

2121
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2222
nodeDefine, exists, reqMain, loadedOptimizedLib,
23-
version = '1.0.3+',
23+
version = '1.0.4',
2424
jsSuffixRegExp = /\.js$/,
2525
commandOption = '',
2626
//Used by jslib/rhino/args.js

dist/r-edge.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license r.js 1.0.3+ 20120104 5:05pm Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
2+
* @license r.js 1.0.4 Copyright (c) 2010-2011, 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
*/
@@ -20,7 +20,7 @@ var requirejs, require, define;
2020

2121
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2222
nodeDefine, exists, reqMain, loadedOptimizedLib,
23-
version = '1.0.3+ 20120104 5:05pm',
23+
version = '1.0.4',
2424
jsSuffixRegExp = /\.js$/,
2525
commandOption = '',
2626
//Used by jslib/rhino/args.js
@@ -101,7 +101,7 @@ var requirejs, require, define;
101101
}
102102

103103
/** vim: et:ts=4:sw=4:sts=4
104-
* @license RequireJS 1.0.3+ Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
104+
* @license RequireJS 1.0.4 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
105105
* Available via the MIT or new BSD license.
106106
* see: http://github.com/jrburke/requirejs for details
107107
*/
@@ -113,7 +113,7 @@ var requirejs, require, define;
113113

114114
(function () {
115115
//Change this version number for each release.
116-
var version = "1.0.3+",
116+
var version = "1.0.4",
117117
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
118118
cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g,
119119
currDirRegExp = /^\.\//,
@@ -778,9 +778,10 @@ var requirejs, require, define;
778778
if (prefix && !plugin) {
779779
prefixMap = makeModuleMap(prefix);
780780

781-
//Clear out urlFetched if the plugin was previously loaded/
782-
//defined, but not as full module (as in a build situation).
783-
//However, only do this work if the plugin is in defined
781+
//Clear out defined and urlFetched if the plugin was previously
782+
//loaded/defined, but not as full module (as in a build
783+
//situation). However, only do this work if the plugin is in
784+
//defined but does not have a module export value.
784785
if (prefix in defined && !defined[prefix]) {
785786
delete defined[prefix];
786787
delete urlFetched[prefixMap.url];

dist/r.js

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license r.js 1.0.3 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
2+
* @license r.js 1.0.4 Copyright (c) 2010-2011, 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
*/
@@ -20,7 +20,7 @@ var requirejs, require, define;
2020

2121
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2222
nodeDefine, exists, reqMain, loadedOptimizedLib,
23-
version = '1.0.3',
23+
version = '1.0.4',
2424
jsSuffixRegExp = /\.js$/,
2525
commandOption = '',
2626
//Used by jslib/rhino/args.js
@@ -101,7 +101,7 @@ var requirejs, require, define;
101101
}
102102

103103
/** vim: et:ts=4:sw=4:sts=4
104-
* @license RequireJS 1.0.3 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
104+
* @license RequireJS 1.0.4 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
105105
* Available via the MIT or new BSD license.
106106
* see: http://github.com/jrburke/requirejs for details
107107
*/
@@ -113,7 +113,7 @@ var requirejs, require, define;
113113

114114
(function () {
115115
//Change this version number for each release.
116-
var version = "1.0.3",
116+
var version = "1.0.4",
117117
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
118118
cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g,
119119
currDirRegExp = /^\.\//,
@@ -425,7 +425,15 @@ var requirejs, require, define;
425425
url = urlMap[normalizedName];
426426
if (!url) {
427427
//Calculate url for the module, if it has a name.
428-
url = context.nameToUrl(normalizedName, null, parentModuleMap);
428+
//Use name here since nameToUrl also calls normalize,
429+
//and for relative names that are outside the baseUrl
430+
//this causes havoc. Was thinking of just removing
431+
//parentModuleMap to avoid extra normalization, but
432+
//normalize() still does a dot removal because of
433+
//issue #142, so just pass in name here and redo
434+
//the normalization. Paths outside baseUrl are just
435+
//messy to support.
436+
url = context.nameToUrl(name, null, parentModuleMap);
429437

430438
//Store the URL mapping for later.
431439
urlMap[normalizedName] = url;
@@ -730,7 +738,7 @@ var requirejs, require, define;
730738
prefix = map.prefix,
731739
plugin = prefix ? plugins[prefix] ||
732740
(plugins[prefix] = defined[prefix]) : null,
733-
manager, created, pluginManager;
741+
manager, created, pluginManager, prefixMap;
734742

735743
if (fullName) {
736744
manager = managerCallbacks[fullName];
@@ -768,7 +776,18 @@ var requirejs, require, define;
768776
//If there is a plugin needed, but it is not loaded,
769777
//first load the plugin, then continue on.
770778
if (prefix && !plugin) {
771-
pluginManager = getManager(makeModuleMap(prefix), true);
779+
prefixMap = makeModuleMap(prefix);
780+
781+
//Clear out defined and urlFetched if the plugin was previously
782+
//loaded/defined, but not as full module (as in a build
783+
//situation). However, only do this work if the plugin is in
784+
//defined but does not have a module export value.
785+
if (prefix in defined && !defined[prefix]) {
786+
delete defined[prefix];
787+
delete urlFetched[prefixMap.url];
788+
}
789+
790+
pluginManager = getManager(prefixMap, true);
772791
pluginManager.add(function (plugin) {
773792
//Create a new manager for the normalized
774793
//resource ID and have it call this manager when
@@ -1839,7 +1858,8 @@ var requirejs, require, define;
18391858
node = context && context.config && context.config.xhtml ?
18401859
document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") :
18411860
document.createElement("script");
1842-
node.type = type || "text/javascript";
1861+
node.type = type || (context && context.config.scriptType) ||
1862+
"text/javascript";
18431863
node.charset = "utf-8";
18441864
//Use async so Gecko does not block on executing the script if something
18451865
//like a long-polling comet tag is being run first. Gecko likes
@@ -7669,7 +7689,7 @@ function (lang, logger, envOptimize, file, parse,
76697689
logger.trace("Uglifying file: " + fileName);
76707690

76717691
try {
7672-
ast = parser.parse(fileContents, config);
7692+
ast = parser.parse(fileContents, config.strict_semicolons);
76737693
ast = processor.ast_mangle(ast, config);
76747694
ast = processor.ast_squeeze(ast, config);
76757695

@@ -7852,8 +7872,13 @@ function (file, pragma, parse) {
78527872
//and to make sure this file is first, so that define calls work.
78537873
//This situation mainly occurs when the build is done on top of the output
78547874
//of another build, where the first build may include require somewhere in it.
7855-
if (!layer.existingRequireUrl && parse.definesRequire(url, contents)) {
7856-
layer.existingRequireUrl = url;
7875+
try {
7876+
if (!layer.existingRequireUrl && parse.definesRequire(url, contents)) {
7877+
layer.existingRequireUrl = url;
7878+
}
7879+
} catch (e1) {
7880+
throw new Error('Parse error using UglifyJS ' +
7881+
'for file: ' + url + '\n' + e1);
78577882
}
78587883

78597884
if (moduleName in context.plugins) {
@@ -7870,12 +7895,17 @@ function (file, pragma, parse) {
78707895
//Parse out the require and define calls.
78717896
//Do this even for plugins in case they have their own
78727897
//dependencies that may be separate to how the pluginBuilder works.
7873-
if (!context.needFullExec[moduleName]) {
7874-
contents = parse(moduleName, url, contents, {
7875-
insertNeedsDefine: true,
7876-
has: context.config.has,
7877-
findNestedDependencies: context.config.findNestedDependencies
7878-
});
7898+
try {
7899+
if (!context.needFullExec[moduleName]) {
7900+
contents = parse(moduleName, url, contents, {
7901+
insertNeedsDefine: true,
7902+
has: context.config.has,
7903+
findNestedDependencies: context.config.findNestedDependencies
7904+
});
7905+
}
7906+
} catch (e2) {
7907+
throw new Error('Parse error using UglifyJS ' +
7908+
'for file: ' + url + '\n' + e2);
78797909
}
78807910

78817911
require._cachedFileContents[url] = contents;
@@ -7939,8 +7969,8 @@ function (file, pragma, parse) {
79397969
} else if (map.url && require._isSupportedBuildUrl(map.url)) {
79407970
//If the url has not been added to the layer yet, and it
79417971
//is from an actual file that was loaded, add it now.
7972+
url = normalizeUrlWithBase(context, map.fullName, map.url);
79427973
if (!layer.pathAdded[url] && layer.buildPathMap[fullName]) {
7943-
url = normalizeUrlWithBase(context, map.fullName, map.url);
79447974
//Remember the list of dependencies for this layer.
79457975
layer.buildFilePaths.push(url);
79467976
layer.pathAdded[url] = true;
@@ -8697,6 +8727,10 @@ function (lang, logger, file, parse, optimize, pragma,
86978727
throw new Error("ERROR: 'baseUrl' option missing.");
86988728
}
86998729

8730+
if (!config.out && !config.dir) {
8731+
throw new Error('Missing either an "out" or "dir" config value.');
8732+
}
8733+
87008734
if (config.out && !config.cssIn) {
87018735
//Just one file to optimize.
87028736

require.js

Lines changed: 6 additions & 5 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 1.0.3+ Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
2+
* @license RequireJS 1.0.4 Copyright (c) 2010-2011, 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
*/
@@ -11,7 +11,7 @@
1111
var requirejs, require, define;
1212
(function () {
1313
//Change this version number for each release.
14-
var version = "1.0.3+",
14+
var version = "1.0.4",
1515
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
1616
cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g,
1717
currDirRegExp = /^\.\//,
@@ -676,9 +676,10 @@ var requirejs, require, define;
676676
if (prefix && !plugin) {
677677
prefixMap = makeModuleMap(prefix);
678678

679-
//Clear out urlFetched if the plugin was previously loaded/
680-
//defined, but not as full module (as in a build situation).
681-
//However, only do this work if the plugin is in defined
679+
//Clear out defined and urlFetched if the plugin was previously
680+
//loaded/defined, but not as full module (as in a build
681+
//situation). However, only do this work if the plugin is in
682+
//defined but does not have a module export value.
682683
if (prefix in defined && !defined[prefix]) {
683684
delete defined[prefix];
684685
delete urlFetched[prefixMap.url];

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