Skip to content

Commit

Permalink
6.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldenning committed Feb 7, 2020
1 parent dfdba67 commit 9cb84ba
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
SystemJS 6.2.2
* Supporting multiple define variations for named modules. Resolves #2118. (https://github.com/systemjs/systemjs/pull/2119)

SystemJS 6.2.1
* Fix problem with named register modules (resolves #2115) (https://github.com/systemjs/systemjs/pull/2116)

Expand Down
30 changes: 17 additions & 13 deletions dist/extras/amd.js
Expand Up @@ -115,38 +115,42 @@
global.define = function (name, deps, execute) {
// define('', [], function () {})
if (typeof name === 'string') {
const depsAndExec = getDepsAndExec(deps, execute);
if (amdDefineDeps) {
if (!System.registerRegistry)
throw Error('Include the named register extension for SystemJS named AMD support.');
addToRegisterRegistry(name, createAMDRegister(deps, execute));
addToRegisterRegistry(name, createAMDRegister(depsAndExec[0], depsAndExec[1]));
amdDefineDeps = [];
amdDefineExec = emptyFn;
return;
}
else {
if (System.registerRegistry)
addToRegisterRegistry(name, createAMDRegister([].concat(deps), execute));
addToRegisterRegistry(name, createAMDRegister([].concat(depsAndExec[0]), depsAndExec[1]));
name = deps;
deps = execute;
}
}
const depsAndExec = getDepsAndExec(name, deps);
amdDefineDeps = depsAndExec[0];
amdDefineExec = depsAndExec[1];
};
global.define.amd = {};

function getDepsAndExec(arg1, arg2) {
// define([], function () {})
if (name instanceof Array) {
amdDefineDeps = name;
amdDefineExec = deps;
if (arg1 instanceof Array) {
return [arg1, arg2];
}
// define({})
else if (typeof name === 'object') {
amdDefineDeps = [];
amdDefineExec = function () { return name };
else if (typeof arg1 === 'object') {
return [[], function () { return arg1 }];
}
// define(function () {})
else if (typeof name === 'function') {
amdDefineDeps = requireExportsModule;
amdDefineExec = name;
else if (typeof arg1 === 'function') {
return [requireExportsModule, arg1];
}
};
global.define.amd = {};
}

function addToRegisterRegistry(name, define) {
if (!firstNamedDefine) {
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.

2 changes: 1 addition & 1 deletion dist/s.js
@@ -1,5 +1,5 @@
/*
* SJS 6.2.1
* SJS 6.2.2
* Minimal SystemJS Build
*/
(function () {
Expand Down
2 changes: 1 addition & 1 deletion dist/system.js
@@ -1,5 +1,5 @@
/*
* SystemJS 6.2.1
* SystemJS 6.2.2
*/
(function () {
const hasSelf = typeof self !== 'undefined';
Expand Down

0 comments on commit 9cb84ba

Please sign in to comment.