Skip to content

Commit

Permalink
Rev for 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jrburke committed Mar 17, 2016
1 parent 98a9949 commit 49b7a28
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 64 deletions.
4 changes: 2 additions & 2 deletions build/jslib/x.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license r.js 2.1.22+ Copyright jQuery Foundation and other contributors.
* @license r.js 2.2.0 Copyright jQuery Foundation and other contributors.
* Released under MIT license, http:https://github.com/requirejs/r.js/LICENSE
*/

Expand All @@ -19,7 +19,7 @@ var requirejs, require, define, xpcUtil;
(function (console, args, readFileFunc) {
var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
version = '2.1.22+',
version = '2.2.0',
jsSuffixRegExp = /\.js$/,
commandOption = '',
useLibLoaded = {},
Expand Down
59 changes: 27 additions & 32 deletions dist/r.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @license r.js 2.1.22+ Thu, 17 Mar 2016 00:36:23 GMT Copyright jQuery Foundation and other contributors.
* @license r.js 2.2.0 Copyright jQuery Foundation and other contributors.
* Released under MIT license, http:https://github.com/requirejs/r.js/LICENSE
*/

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

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

if (this.depCount < 1 && !this.defined) {
if (isFunction(factory)) {
try {
//If there is an error listener, favor passing
//to that instead of throwing an error. However,
//only do it for define()'d modules. require
//errbacks should not be called for failures in
//their callbacks (#699). However if a global
//onError is set, use that.
if ((this.events.error && this.map.isDefine) ||
req.onError !== defaultOnError) {
try {
exports = context.execCb(id, factory, depExports, exports);
} catch (e) {
err = e;
}
} else {
exports = context.execCb(id, factory, depExports, exports);
} catch (e) {
err = e;
}

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

if (err) {
// If there is an error listener, favor passing
// to that instead of throwing an error. However,
// only do it for define()'d modules. require
// errbacks should not be called for failures in
// their callbacks (#699). However if a global
// onError is set, use that.
if ((this.events.error && this.map.isDefine) ||
req.onError !== defaultOnError) {
err.requireMap = this.map;
err.requireModules = this.map.isDefine ? [this.map.id] : null;
err.requireType = this.map.isDefine ? 'define' : 'require';
return onError((this.error = err));
} else if (typeof console !== 'undefined' &&
console.error) {
// Log the error for debugging. If promises could be
// used, this would be different, but making do.
console.error(err);
} else {
// Do not want to completely lose the error. While this
// will mess up processing and lead to similar results
// as bug 1440, it at least surfaces the error.
req.onError(err);
}
err.requireMap = this.map;
err.requireModules = this.map.isDefine ? [this.map.id] : null;
err.requireType = this.map.isDefine ? 'define' : 'require';
return onError((this.error = err));
}

} else {
//Just a literal value
exports = factory;
Expand Down Expand Up @@ -2274,8 +2267,10 @@ var requirejs, require, define, xpcUtil;
//Preserve dataMain in case it is a path (i.e. contains '?')
mainScript = dataMain;

//Set final baseUrl if there is not already an explicit one.
if (!cfg.baseUrl) {
//Set final baseUrl if there is not already an explicit one,
//but only do so if the data-main value is not a loader plugin
//module ID.
if (!cfg.baseUrl && mainScript.indexOf('!') === -1) {
//Pull off the directory of data-main for use as the
//baseUrl.
src = mainScript.split('/');
Expand Down
55 changes: 25 additions & 30 deletions require.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.1.22 Copyright jQuery Foundation and other contributors.
* @license RequireJS 2.2.0 Copyright jQuery Foundation and other contributors.
* Released under MIT license, http:https://github.com/requirejs/requirejs/LICENSE
*/
//Not using strict: uneven strict support in browsers, #392, and causes
Expand All @@ -11,7 +11,7 @@ var requirejs, require, define;
(function (global) {
var req, s, head, baseElement, dataMain, src,
interactiveScript, currentlyAddingScript, mainScript, subPath,
version = '2.1.22',
version = '2.2.0',
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
jsSuffixRegExp = /\.js$/,
Expand Down Expand Up @@ -864,10 +864,21 @@ var requirejs, require, define;

if (this.depCount < 1 && !this.defined) {
if (isFunction(factory)) {
try {
//If there is an error listener, favor passing
//to that instead of throwing an error. However,
//only do it for define()'d modules. require
//errbacks should not be called for failures in
//their callbacks (#699). However if a global
//onError is set, use that.
if ((this.events.error && this.map.isDefine) ||
req.onError !== defaultOnError) {
try {
exports = context.execCb(id, factory, depExports, exports);
} catch (e) {
err = e;
}
} else {
exports = context.execCb(id, factory, depExports, exports);
} catch (e) {
err = e;
}

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

if (err) {
// If there is an error listener, favor passing
// to that instead of throwing an error. However,
// only do it for define()'d modules. require
// errbacks should not be called for failures in
// their callbacks (#699). However if a global
// onError is set, use that.
if ((this.events.error && this.map.isDefine) ||
req.onError !== defaultOnError) {
err.requireMap = this.map;
err.requireModules = this.map.isDefine ? [this.map.id] : null;
err.requireType = this.map.isDefine ? 'define' : 'require';
return onError((this.error = err));
} else if (typeof console !== 'undefined' &&
console.error) {
// Log the error for debugging. If promises could be
// used, this would be different, but making do.
console.error(err);
} else {
// Do not want to completely lose the error. While this
// will mess up processing and lead to similar results
// as bug 1440, it at least surfaces the error.
req.onError(err);
}
err.requireMap = this.map;
err.requireModules = this.map.isDefine ? [this.map.id] : null;
err.requireType = this.map.isDefine ? 'define' : 'require';
return onError((this.error = err));
}

} else {
//Just a literal value
exports = factory;
Expand Down Expand Up @@ -2025,8 +2018,10 @@ var requirejs, require, define;
//Preserve dataMain in case it is a path (i.e. contains '?')
mainScript = dataMain;

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

0 comments on commit 49b7a28

Please sign in to comment.