Skip to content

Commit

Permalink
6.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning committed Jan 28, 2020
1 parent 66332b8 commit ac6c35e
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 14 deletions.
13 changes: 12 additions & 1 deletion dist/extras/amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
throw Error('AMD require not supported.');
}

let tmpRegister;
let tmpRegister, firstNamedDefine;

function emptyFn () {}

Expand Down Expand Up @@ -88,6 +88,10 @@
if (register && register[1] === lastRegisterDeclare)
return register;

// If the script registered a named module, return that module instead of re-instantiating it.
if (firstNamedDefine)
return firstNamedDefine;

// otherwise AMD takes priority
// no registration -> attempt AMD detection
if (!amdDefineDeps)
Expand Down Expand Up @@ -135,6 +139,13 @@
global.define.amd = {};

function addToRegisterRegistry(name, define) {
if (!firstNamedDefine) {
firstNamedDefine = define;
setTimeout(function () {
firstNamedDefine = null;
});
}

// We must call System.getRegister() here to give other extras, such as the named-exports extra,
// a chance to modify the define before it's put into the registerRegistry.
// See https://github.com/systemjs/systemjs/issues/2073
Expand Down
2 changes: 1 addition & 1 deletion dist/extras/amd.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/extras/amd.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions dist/extras/named-register.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,21 @@
this.registerRegistry[name] = define;
if (!firstNamedDefine) {
firstNamedDefine = define;
setTimeout(clearFirstNamedDefine, 0);
setTimeout(clearFirstNamedDefine);
}
return register.apply(this, arguments);
};

const resolve = systemJSPrototype.resolve;
systemJSPrototype.resolve = function (id, parentURL) {
if (id[0] === '/' || id[0] === '.' && (id[1] === '/' || id[1] === '.' && id[2] === '/'))
try {
// Prefer import map (or other existing) resolution over the registerRegistry
return resolve.call(this, id, parentURL);
if (id in this.registerRegistry)
return id;
return resolve.call(this, id, parentURL);
} catch (err) {
if (id in this.registerRegistry)
return id;
throw err;
}
};

const instantiate = systemJSPrototype.instantiate;
Expand Down
2 changes: 1 addition & 1 deletion dist/extras/named-register.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/extras/named-register.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/s.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SJS 6.1.9
* SJS 6.1.10
* Minimal SystemJS Build
*/
(function () {
Expand Down
2 changes: 1 addition & 1 deletion dist/system.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SystemJS 6.1.9
* SystemJS 6.1.10
*/
(function () {
const hasSelf = typeof self !== 'undefined';
Expand Down

0 comments on commit ac6c35e

Please sign in to comment.