11/**
2- * @license r.js 2.1.19 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
2+ * @license r.js 2.1.20 Copyright (c) 2010-2015, 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, xpcUtil;
2020(function (console, args, readFileFunc) {
2121 var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
2222 nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
23- version = '2.1.19 ',
23+ version = '2.1.20 ',
2424 jsSuffixRegExp = /\.js$/,
2525 commandOption = '',
2626 useLibLoaded = {},
@@ -249,7 +249,7 @@ var requirejs, require, define, xpcUtil;
249249 }
250250
251251 /** vim: et:ts=4:sw=4:sts=4
252- * @license RequireJS 2.1.19 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
252+ * @license RequireJS 2.1.20 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
253253 * Available via the MIT or new BSD license.
254254 * see: http://github.com/jrburke/requirejs for details
255255 */
@@ -262,7 +262,7 @@ var requirejs, require, define, xpcUtil;
262262(function (global) {
263263 var req, s, head, baseElement, dataMain, src,
264264 interactiveScript, currentlyAddingScript, mainScript, subPath,
265- version = '2.1.19 ',
265+ version = '2.1.20 ',
266266 commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
267267 cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
268268 jsSuffixRegExp = /\.js$/,
@@ -271,7 +271,6 @@ var requirejs, require, define, xpcUtil;
271271 ostring = op.toString,
272272 hasOwn = op.hasOwnProperty,
273273 ap = Array.prototype,
274- apsp = ap.splice,
275274 isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
276275 isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
277276 //PS3 indicates loaded and complete, but need to wait for complete
@@ -804,11 +803,13 @@ var requirejs, require, define, xpcUtil;
804803 function takeGlobalQueue() {
805804 //Push all the globalDefQueue items into the context's defQueue
806805 if (globalDefQueue.length) {
807- //Array splice in the values since the context code has a
808- //local var ref to defQueue, so cannot just reassign the one
809- //on context.
810- apsp.apply(defQueue,
811- [defQueue.length, 0].concat(globalDefQueue));
806+ each(globalDefQueue, function(queueItem) {
807+ var id = queueItem[0];
808+ if (typeof id === 'string') {
809+ context.defQueueMap[id] = true;
810+ }
811+ defQueue.push(queueItem);
812+ });
812813 globalDefQueue = [];
813814 }
814815 }
@@ -1095,7 +1096,10 @@ var requirejs, require, define, xpcUtil;
10951096 factory = this.factory;
10961097
10971098 if (!this.inited) {
1098- this.fetch();
1099+ // Only fetch if not already in the defQueue.
1100+ if (!hasProp(context.defQueueMap, id)) {
1101+ this.fetch();
1102+ }
10991103 } else if (this.error) {
11001104 this.emit('error', this.error);
11011105 } else if (!this.defining) {
@@ -1494,6 +1498,7 @@ var requirejs, require, define, xpcUtil;
14941498 callGetModule(args);
14951499 }
14961500 }
1501+ context.defQueueMap = {};
14971502 }
14981503
14991504 context = {
@@ -1503,6 +1508,7 @@ var requirejs, require, define, xpcUtil;
15031508 defined: defined,
15041509 urlFetched: urlFetched,
15051510 defQueue: defQueue,
1511+ defQueueMap: {},
15061512 Module: Module,
15071513 makeModuleMap: makeModuleMap,
15081514 nextTick: req.nextTick,
@@ -1752,6 +1758,7 @@ var requirejs, require, define, xpcUtil;
17521758 defQueue.splice(i, 1);
17531759 }
17541760 });
1761+ delete context.defQueueMap[id];
17551762
17561763 if (mod) {
17571764 //Hold on to listeners in case the
@@ -1813,6 +1820,7 @@ var requirejs, require, define, xpcUtil;
18131820
18141821 callGetModule(args);
18151822 }
1823+ context.defQueueMap = {};
18161824
18171825 //Do this after the cycle of callGetModule in case the result
18181826 //of those calls/init calls changes the registry.
@@ -2317,7 +2325,12 @@ var requirejs, require, define, xpcUtil;
23172325 //where the module name is not known until the script onload event
23182326 //occurs. If no context, use the global queue, and get it processed
23192327 //in the onscript load callback.
2320- (context ? context.defQueue : globalDefQueue).push([name, deps, callback]);
2328+ if (context) {
2329+ context.defQueue.push([name, deps, callback]);
2330+ context.defQueueMap[name] = true;
2331+ } else {
2332+ globalDefQueue.push([name, deps, callback]);
2333+ }
23212334 };
23222335
23232336 define.amd = {
@@ -26059,7 +26072,8 @@ define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
2605926072 parse.parseNode = function (node, onMatch, fnExpScope) {
2606026073 var name, deps, cjsDeps, arg, factory, exp, refsDefine, bodyNode,
2606126074 args = node && node[argPropName],
26062- callName = parse.hasRequire(node);
26075+ callName = parse.hasRequire(node),
26076+ isUmd = false;
2606326077
2606426078 if (callName === 'require' || callName === 'requirejs') {
2606526079 //A plain require/requirejs call
@@ -26091,6 +26105,13 @@ define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
2609126105 //Just the factory, no name or deps
2609226106 factory = name;
2609326107 name = deps = null;
26108+ } else if (name.type === 'Identifier' && args.length === 1 &&
26109+ hasProp(fnExpScope, name.name)) {
26110+ //define(e) where e is a UMD identifier for the factory
26111+ //function.
26112+ isUmd = true;
26113+ factory = name;
26114+ name = null;
2609426115 } else if (name.type !== 'Literal') {
2609526116 //An object literal, just null out
2609626117 name = deps = factory = null;
@@ -26127,7 +26148,7 @@ define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {
2612726148 if (cjsDeps.length) {
2612826149 deps = cjsDeps;
2612926150 }
26130- } else if (deps || factory) {
26151+ } else if (deps || ( factory && !isUmd) ) {
2613126152 //Does not match the shape of an AMD call.
2613226153 return;
2613326154 }
@@ -26772,6 +26793,8 @@ define('pragma', ['parse', 'logger'], function (parse, logger) {
2677226793 defineJQueryRegExp: /typeof\s+define\s*===?\s*["']function["']\s*&&\s*define\s*\.\s*amd\s*&&\s*define\s*\.\s*amd\s*\.\s*jQuery/g,
2677326794 defineHasRegExp: /typeof\s+define\s*==(=)?\s*['"]function['"]\s*&&\s*typeof\s+define\.amd\s*==(=)?\s*['"]object['"]\s*&&\s*define\.amd/g,
2677426795 defineTernaryRegExp: /typeof\s+define\s*===?\s*['"]function["']\s*&&\s*define\s*\.\s*amd\s*\?\s*define/,
26796+ defineExistsRegExp: /\s+typeof\s+define\s*!==?\s*['"]undefined["']\s*/,
26797+ defineExistsAndAmdRegExp: /typeof\s+define\s*!==?\s*['"]undefined["']\s*&&\s*define\s*\.\s*amd\s*/,
2677526798 amdefineRegExp: /if\s*\(\s*typeof define\s*\!==\s*'function'\s*\)\s*\{\s*[^\{\}]+amdefine[^\{\}]+\}/g,
2677626799
2677726800 removeStrict: function (contents, config) {
@@ -26798,6 +26821,10 @@ define('pragma', ['parse', 'logger'], function (parse, logger) {
2679826821 fileContents = fileContents.replace(pragma.defineHasRegExp,
2679926822 "typeof " + ns + ".define === 'function' && typeof " + ns + ".define.amd === 'object' && " + ns + ".define.amd");
2680026823
26824+ //Namespace async.js define use:
26825+ fileContents = fileContents.replace(pragma.defineExistsAndAmdRegExp,
26826+ "typeof " + ns + ".define !== 'undefined' && " + ns + ".define.amd");
26827+
2680126828 //Namespace define checks.
2680226829 //Do these ones last, since they are a subset of the more specific
2680326830 //checks above.
@@ -26807,6 +26834,8 @@ define('pragma', ['parse', 'logger'], function (parse, logger) {
2680726834 "typeof " + ns + ".define === 'function' && " + ns + ".define['amd']");
2680826835 fileContents = fileContents.replace(pragma.defineTypeFirstCheckRegExp,
2680926836 "'function' === typeof " + ns + ".define && " + ns + ".define.amd");
26837+ fileContents = fileContents.replace(pragma.defineExistsRegExp,
26838+ "typeof " + ns + ".define !== 'undefined'");
2681026839
2681126840 //Check for require.js with the require/define definitions
2681226841 if (pragma.apiDefRegExp.test(fileContents) &&
@@ -26994,6 +27023,7 @@ define('pragma', ['parse', 'logger'], function (parse, logger) {
2699427023
2699527024 return pragma;
2699627025});
27026+
2699727027if(env === 'browser') {
2699827028/**
2699927029 * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
0 commit comments