Permalink
Browse files

Upstream the module changes from bug 756542.

  • Loading branch information...
1 parent 34dcf92 commit 8e4804cedcb7de166a06eec78a94e6be417e7607 @Mossop committed Dec 12, 2012
Showing with 8 additions and 6 deletions.
  1. +4 −3 lib/sdk/core/promise.js
  2. +4 −3 lib/toolkit/loader.js
@@ -8,19 +8,20 @@
} else if (typeof(require) === 'function') { // CommonJS
factory.call(this, require, exports, module);
} else if (~String(this).indexOf('BackstagePass')) { // JSM
+ this[factory.name] = {};
factory(function require(uri) {
var imports = {};
this['Components'].utils.import(uri, imports);
return imports;
- }, this, { uri: __URI__, id: id });
- this.EXPORTED_SYMBOLS = Object.keys(this);
+ }, this[factory.name], { uri: __URI__, id: id });
+ this.EXPORTED_SYMBOLS = [factory.name];
} else { // Browser or alike
var globals = this
factory(function require(id) {
return globals[id];
}, (globals[id] = {}), { uri: document.location.href + '#' + id, id: id });
}
-}).call(this, 'loader', function(require, exports, module) {
+}).call(this, 'loader', function Promise(require, exports, module) {
'use strict';
@@ -9,12 +9,13 @@
} else if (typeof(require) === 'function') { // CommonJS
factory.call(this, require, exports, module);
} else if (~String(this).indexOf('BackstagePass')) { // JSM
+ this[factory.name] = {};
factory(function require(uri) {
var imports = {};
this['Components'].utils.import(uri, imports);
return imports;
- }, this, { uri: __URI__, id: id });
- this.EXPORTED_SYMBOLS = Object.keys(this);
+ }, this[factory.name], { uri: __URI__, id: id });
+ this.EXPORTED_SYMBOLS = [factory.name];
} else if (~String(this).indexOf('Sandbox')) { // Sandbox
factory(function require(uri) {}, this, { uri: __URI__, id: id });
} else { // Browser or alike
@@ -23,7 +24,7 @@
return globals[id];
}, (globals[id] = {}), { uri: document.location.href + '#' + id, id: id });
}
-}).call(this, 'loader', function(require, exports, module) {
+}).call(this, 'loader', function Loader(require, exports, module) {
'use strict';

0 comments on commit 8e4804c

Please sign in to comment.