diff --git a/dist/sea-debug.js b/dist/sea-debug.js index 097bdcdc..f7f21f89 100644 --- a/dist/sea-debug.js +++ b/dist/sea-debug.js @@ -929,9 +929,12 @@ seajs._config = { if (resolvedUri) { // If the first module in a package is not the cachedModules[derivedUri] // self, it should assign it to the correct module when found. - if (resolvedUri === derivedUri && - (cachedModules[derivedUri] || {}).status === STATUS.SAVED) { - cachedModules[derivedUri] = null + if (resolvedUri === derivedUri) { + var refModule = cachedModules[derivedUri] + if (refModule && refModule.packageUri && + refModule.status === STATUS.SAVED) { + cachedModules[derivedUri] = null + } } var module = save(resolvedUri, meta) @@ -941,6 +944,7 @@ seajs._config = { // cachedModules[derivedUri] may be undefined in combo case. if ((cachedModules[derivedUri] || {}).status === STATUS.FETCHING) { cachedModules[derivedUri] = module + module.packageUri = derivedUri } } else { @@ -1066,6 +1070,7 @@ seajs._config = { // See: test/issues/un-correspondence if (firstModuleInPackage && module.status === STATUS.FETCHED) { cachedModules[uri] = firstModuleInPackage + firstModuleInPackage.packageUri = uri } firstModuleInPackage = null diff --git a/dist/sea.js b/dist/sea.js index e7414d7c..8abacffa 100644 --- a/dist/sea.js +++ b/dist/sea.js @@ -6,24 +6,24 @@ this.seajs={_seajs:this.seajs};seajs.version="1.2.0";seajs._util={};seajs._confi (function(a){var c=Object.prototype.toString,d=Array.prototype;a.isString=function(a){return"[object String]"===c.call(a)};a.isFunction=function(a){return"[object Function]"===c.call(a)};a.isRegExp=function(a){return"[object RegExp]"===c.call(a)};a.isObject=function(a){return a===Object(a)};a.isArray=Array.isArray||function(a){return"[object Array]"===c.call(a)};a.indexOf=d.indexOf?function(a,c){return a.indexOf(c)}:function(a,c){for(var b=0;bNumber(g.replace(/.*AppleWebKit\/(\d+)\..*/,"$1")),p=0 "),void 0);return!a})}function l(a,b){if(!a|| -a.status!==f.SAVED)return!1;v.push(a.uri);var d=a.dependencies;if(d.length){if(-1=f.SAVED){var q=r(d);q.length?b.prototype._load(q,function(){e(d)}):e(d)}else e()}var d=h[a]||(h[a]=new b(a,f.FETCHING));d.status>=f.FETCHED?c():o(a,c)})(y[j])};b.prototype._compile=function(){function a(c){c=e(c,b.uri);c=h[c];if(!c)return null;if(c.status===f.COMPILING)return c.exports;c.parent=b;return c._compile()}var b=this;if(b.status=== -f.COMPILED)return b.exports;if(b.status "),void 0);return!a})}function k(a, +b){if(!a||a.status!==f.SAVED)return!1;v.push(a.uri);var d=a.dependencies;if(d.length){if(-1=f.SAVED){var r=s(d);r.length?b.prototype._load(r,function(){e(d)}):e(d)}else e()}var d=h[a]||(h[a]=new b(a,f.FETCHING));d.status>=f.FETCHED?c():o(a,c)})(y[j])};b.prototype._compile=function(){function a(c){c=e(c,b.uri);c=h[c];if(!c)return null;if(c.status===f.COMPILING)return c.exports;c.parent=b;return c._compile()}var b= +this;if(b.status===f.COMPILED)return b.exports;if(b.status seajs.config({ - base: './' + base: '.' }); seajs.use('main'); diff --git a/test/modules/require-async/program.js b/test/modules/require-async/program.js index fc48fb11..881a809c 100644 --- a/test/modules/require-async/program.js +++ b/test/modules/require-async/program.js @@ -1,7 +1,10 @@ define(function(require) { var test = require('../../test') - var path = 'http://seajs.org/test/modules/require-async/' + + var path = typeof global !== 'undefined' ? // node environment + 'http://seajs.org/test/modules/require-async/' : + './' require.async(['./a', path + 'b.js', path + 'c.js'], function(a, b, c) { diff --git a/test/runtime/order-no-matter/main.js b/test/runtime/order-no-matter/main.js index 7330d346..81784937 100644 --- a/test/runtime/order-no-matter/main.js +++ b/test/runtime/order-no-matter/main.js @@ -1,3 +1,3 @@ define("increment",["math"],function(a,b){var c=a("./math").add;b.increment=function(a){return c(a,1)}}); define("math",[],function(a,b){b.add=function(){var a=0,b=0,c=arguments.length;while(b 0) { + var isLocal = location.href.indexOf('/~lifesinger/') > 0 + + if (isLocal) { MODULES_PATH = 'http://' + location.host + '/~lifesinger/seajs/spm/modules/' } @@ -29,6 +31,9 @@ }) - define({ isMobile: isMobile }) + define({ + isMobile: isMobile, + isLocal: isLocal + }) })()