Skip to content

Commit 49b7a28

Browse files
committed
Rev for 2.2.0
1 parent 98a9949 commit 49b7a28

File tree

3 files changed

+54
-64
lines changed

3 files changed

+54
-64
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 2.1.22+ Copyright jQuery Foundation and other contributors.
2+
* @license r.js 2.2.0 Copyright jQuery Foundation and other contributors.
33
* Released under MIT license, http://github.com/requirejs/r.js/LICENSE
44
*/
55

@@ -19,7 +19,7 @@ var requirejs, require, define, xpcUtil;
1919
(function (console, args, readFileFunc) {
2020
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2121
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
22-
version = '2.1.22+',
22+
version = '2.2.0',
2323
jsSuffixRegExp = /\.js$/,
2424
commandOption = '',
2525
useLibLoaded = {},

dist/r.js

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license r.js 2.1.22+ Thu, 17 Mar 2016 00:36:23 GMT Copyright jQuery Foundation and other contributors.
2+
* @license r.js 2.2.0 Copyright jQuery Foundation and other contributors.
33
* Released under MIT license, http://github.com/requirejs/r.js/LICENSE
44
*/
55

@@ -19,7 +19,7 @@ var requirejs, require, define, xpcUtil;
1919
(function (console, args, readFileFunc) {
2020
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2121
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
22-
version = '2.1.22+ Thu, 17 Mar 2016 00:36:23 GMT',
22+
version = '2.2.0',
2323
jsSuffixRegExp = /\.js$/,
2424
commandOption = '',
2525
useLibLoaded = {},
@@ -248,7 +248,7 @@ var requirejs, require, define, xpcUtil;
248248
}
249249

250250
/** vim: et:ts=4:sw=4:sts=4
251-
* @license RequireJS 2.1.22 Copyright jQuery Foundation and other contributors.
251+
* @license RequireJS 2.2.0 Copyright jQuery Foundation and other contributors.
252252
* Released under MIT license, http://github.com/requirejs/requirejs/LICENSE
253253
*/
254254
//Not using strict: uneven strict support in browsers, #392, and causes
@@ -260,7 +260,7 @@ var requirejs, require, define, xpcUtil;
260260
(function (global) {
261261
var req, s, head, baseElement, dataMain, src,
262262
interactiveScript, currentlyAddingScript, mainScript, subPath,
263-
version = '2.1.22',
263+
version = '2.2.0',
264264
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
265265
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
266266
jsSuffixRegExp = /\.js$/,
@@ -1113,10 +1113,21 @@ var requirejs, require, define, xpcUtil;
11131113

11141114
if (this.depCount < 1 && !this.defined) {
11151115
if (isFunction(factory)) {
1116-
try {
1116+
//If there is an error listener, favor passing
1117+
//to that instead of throwing an error. However,
1118+
//only do it for define()'d modules. require
1119+
//errbacks should not be called for failures in
1120+
//their callbacks (#699). However if a global
1121+
//onError is set, use that.
1122+
if ((this.events.error && this.map.isDefine) ||
1123+
req.onError !== defaultOnError) {
1124+
try {
1125+
exports = context.execCb(id, factory, depExports, exports);
1126+
} catch (e) {
1127+
err = e;
1128+
}
1129+
} else {
11171130
exports = context.execCb(id, factory, depExports, exports);
1118-
} catch (e) {
1119-
err = e;
11201131
}
11211132

11221133
// Favor return value over exports. If node/cjs in play,
@@ -1133,30 +1144,12 @@ var requirejs, require, define, xpcUtil;
11331144
}
11341145

11351146
if (err) {
1136-
// If there is an error listener, favor passing
1137-
// to that instead of throwing an error. However,
1138-
// only do it for define()'d modules. require
1139-
// errbacks should not be called for failures in
1140-
// their callbacks (#699). However if a global
1141-
// onError is set, use that.
1142-
if ((this.events.error && this.map.isDefine) ||
1143-
req.onError !== defaultOnError) {
1144-
err.requireMap = this.map;
1145-
err.requireModules = this.map.isDefine ? [this.map.id] : null;
1146-
err.requireType = this.map.isDefine ? 'define' : 'require';
1147-
return onError((this.error = err));
1148-
} else if (typeof console !== 'undefined' &&
1149-
console.error) {
1150-
// Log the error for debugging. If promises could be
1151-
// used, this would be different, but making do.
1152-
console.error(err);
1153-
} else {
1154-
// Do not want to completely lose the error. While this
1155-
// will mess up processing and lead to similar results
1156-
// as bug 1440, it at least surfaces the error.
1157-
req.onError(err);
1158-
}
1147+
err.requireMap = this.map;
1148+
err.requireModules = this.map.isDefine ? [this.map.id] : null;
1149+
err.requireType = this.map.isDefine ? 'define' : 'require';
1150+
return onError((this.error = err));
11591151
}
1152+
11601153
} else {
11611154
//Just a literal value
11621155
exports = factory;
@@ -2274,8 +2267,10 @@ var requirejs, require, define, xpcUtil;
22742267
//Preserve dataMain in case it is a path (i.e. contains '?')
22752268
mainScript = dataMain;
22762269

2277-
//Set final baseUrl if there is not already an explicit one.
2278-
if (!cfg.baseUrl) {
2270+
//Set final baseUrl if there is not already an explicit one,
2271+
//but only do so if the data-main value is not a loader plugin
2272+
//module ID.
2273+
if (!cfg.baseUrl && mainScript.indexOf('!') === -1) {
22792274
//Pull off the directory of data-main for use as the
22802275
//baseUrl.
22812276
src = mainScript.split('/');

require.js

Lines changed: 25 additions & 30 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 2.1.22 Copyright jQuery Foundation and other contributors.
2+
* @license RequireJS 2.2.0 Copyright jQuery Foundation and other contributors.
33
* Released under MIT license, http://github.com/requirejs/requirejs/LICENSE
44
*/
55
//Not using strict: uneven strict support in browsers, #392, and causes
@@ -11,7 +11,7 @@ var requirejs, require, define;
1111
(function (global) {
1212
var req, s, head, baseElement, dataMain, src,
1313
interactiveScript, currentlyAddingScript, mainScript, subPath,
14-
version = '2.1.22',
14+
version = '2.2.0',
1515
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
1616
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
1717
jsSuffixRegExp = /\.js$/,
@@ -864,10 +864,21 @@ var requirejs, require, define;
864864

865865
if (this.depCount < 1 && !this.defined) {
866866
if (isFunction(factory)) {
867-
try {
867+
//If there is an error listener, favor passing
868+
//to that instead of throwing an error. However,
869+
//only do it for define()'d modules. require
870+
//errbacks should not be called for failures in
871+
//their callbacks (#699). However if a global
872+
//onError is set, use that.
873+
if ((this.events.error && this.map.isDefine) ||
874+
req.onError !== defaultOnError) {
875+
try {
876+
exports = context.execCb(id, factory, depExports, exports);
877+
} catch (e) {
878+
err = e;
879+
}
880+
} else {
868881
exports = context.execCb(id, factory, depExports, exports);
869-
} catch (e) {
870-
err = e;
871882
}
872883

873884
// Favor return value over exports. If node/cjs in play,
@@ -884,30 +895,12 @@ var requirejs, require, define;
884895
}
885896

886897
if (err) {
887-
// If there is an error listener, favor passing
888-
// to that instead of throwing an error. However,
889-
// only do it for define()'d modules. require
890-
// errbacks should not be called for failures in
891-
// their callbacks (#699). However if a global
892-
// onError is set, use that.
893-
if ((this.events.error && this.map.isDefine) ||
894-
req.onError !== defaultOnError) {
895-
err.requireMap = this.map;
896-
err.requireModules = this.map.isDefine ? [this.map.id] : null;
897-
err.requireType = this.map.isDefine ? 'define' : 'require';
898-
return onError((this.error = err));
899-
} else if (typeof console !== 'undefined' &&
900-
console.error) {
901-
// Log the error for debugging. If promises could be
902-
// used, this would be different, but making do.
903-
console.error(err);
904-
} else {
905-
// Do not want to completely lose the error. While this
906-
// will mess up processing and lead to similar results
907-
// as bug 1440, it at least surfaces the error.
908-
req.onError(err);
909-
}
898+
err.requireMap = this.map;
899+
err.requireModules = this.map.isDefine ? [this.map.id] : null;
900+
err.requireType = this.map.isDefine ? 'define' : 'require';
901+
return onError((this.error = err));
910902
}
903+
911904
} else {
912905
//Just a literal value
913906
exports = factory;
@@ -2025,8 +2018,10 @@ var requirejs, require, define;
20252018
//Preserve dataMain in case it is a path (i.e. contains '?')
20262019
mainScript = dataMain;
20272020

2028-
//Set final baseUrl if there is not already an explicit one.
2029-
if (!cfg.baseUrl) {
2021+
//Set final baseUrl if there is not already an explicit one,
2022+
//but only do so if the data-main value is not a loader plugin
2023+
//module ID.
2024+
if (!cfg.baseUrl && mainScript.indexOf('!') === -1) {
20302025
//Pull off the directory of data-main for use as the
20312026
//baseUrl.
20322027
src = mainScript.split('/');

0 commit comments

Comments
 (0)