Permalink
Browse files

Upgrade to RequireJS 1.0.8

  • Loading branch information...
1 parent 2871cdd commit 42183cd13a9d818f74a552993789caecf2e573b1 @gseguin gseguin committed Jun 14, 2012
Showing with 2,764 additions and 59 deletions.
  1. +2,745 −50 external/r.js/dist/r.js
  2. +19 −9 external/requirejs/require.js
View
@@ -1,15 +1,15 @@
/** vim: et:ts=4:sw=4:sts=4
- * @license RequireJS 1.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ * @license RequireJS 1.0.8 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
/*jslint strict: false, plusplus: false, sub: true */
/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */
var requirejs, require, define;
-(function () {
+(function (undefined) {
//Change this version number for each release.
- var version = "1.0.6",
+ var version = "1.0.8",
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g,
currDirRegExp = /^\.\//,
@@ -423,18 +423,19 @@ var requirejs, require, define;
fullName = map.fullName,
args = manager.deps,
listeners = manager.listeners,
+ execCb = config.requireExecCb || req.execCb,
cjsModule;
//Call the callback to define the module, if necessary.
if (cb && isFunction(cb)) {
if (config.catchError.define) {
try {
- ret = req.execCb(fullName, manager.callback, args, defined[fullName]);
+ ret = execCb(fullName, manager.callback, args, defined[fullName]);
} catch (e) {
err = e;
}
} else {
- ret = req.execCb(fullName, manager.callback, args, defined[fullName]);
+ ret = execCb(fullName, manager.callback, args, defined[fullName]);
}
if (fullName) {
@@ -1174,7 +1175,7 @@ var requirejs, require, define;
} else {
//Regular dependency.
if (!urlFetched[url] && !loaded[fullName]) {
- req.load(context, fullName, url);
+ (config.requireLoad || req.load)(context, fullName, url);
//Mark the URL as fetched, but only if it is
//not an empty: URL, used by the optimizer.
@@ -1478,7 +1479,8 @@ var requirejs, require, define;
moduleName = normalize(moduleName, relModuleMap && relModuleMap.fullName);
//If a colon is in the URL, it indicates a protocol is used and it is just
- //an URL to a file, or if it starts with a slash or ends with .js, it is just a plain file.
+ //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
+ //or ends with .js, then assume the user meant to use an url and not a module id.
//The slash is important for protocol-less URLs as well as full paths.
if (req.jsExtRegExp.test(moduleName)) {
//Just a plain path, not module name lookup, so just return it.
@@ -1514,7 +1516,7 @@ var requirejs, require, define;
//Join the path parts together, then figure out if baseUrl is needed.
url = syms.join("/") + (ext || ".js");
- url = (url.charAt(0) === '/' || url.match(/^\w+:/) ? "" : config.baseUrl) + url;
+ url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? "" : config.baseUrl) + url;
}
return config.urlArgs ? url +
@@ -1878,7 +1880,15 @@ var requirejs, require, define;
//https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
//UNFORTUNATELY Opera implements attachEvent but does not follow the script
//script execution mode.
- if (node.attachEvent && !isOpera) {
+ if (node.attachEvent &&
+ // check if node.attachEvent is artificially added by custom script or
+ // natively supported by browser
+ // read https://github.com/jrburke/requirejs/issues/187
+ // if we can NOT find [native code] then it must NOT natively supported.
+ // in IE8, node.attachEvent does not have toString()
+ // TODO: a better way to check interactive mode
+ !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code]') < 0) &&
+ !isOpera) {
//Probably IE. IE (at least 6-8) do not fire
//script onload right after executing the script, so
//we cannot tie the anonymous define call to a name.

0 comments on commit 42183cd

Please sign in to comment.