Skip to content

Commit

Permalink
6.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Nov 26, 2020
1 parent 48351aa commit d762870
Show file tree
Hide file tree
Showing 12 changed files with 5,556 additions and 5,473 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
SystemJS 6.8.0
* System.firstGlobalProp for global loading extra (https://github.com/systemjs/systemjs/commit/48351aa83c48fdd22b63000d417dedc2329f2340, @joeldenning)
* Graceful import map loading errors (https://github.com/systemjs/systemjs/commit/9edebd1969842dcc95a12d4137677c6bc9fe2bae, @naltatis)
* Sourcemap normalization for fetch loader (https://github.com/systemjs/systemjs/commit/97621d724cc7c892d9dee2cff6b27553326c8169)
* Dispatch script loading errors for `<script type="systemjs-module">` (https://github.com/systemjs/systemjs/commit/f0fe5a473414b995082688c30a876c602e32d901, @dmail)

SystemJS 6.7.1
* Fix auto import race condition (https://github.com/systemjs/systemjs/pull/2266)

Expand Down
13 changes: 9 additions & 4 deletions dist/extras/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,23 @@
var firstGlobalProp, secondGlobalProp, lastGlobalProp;
function getGlobalProp () {
var cnt = 0;
var lastProp;
var foundLastProp, result;
for (var p in global) {
// do not check frames cause it could be removed during import
if (shouldSkipProperty(p))
continue;
if (cnt === 0 && p !== firstGlobalProp || cnt === 1 && p !== secondGlobalProp)
return p;
if (foundLastProp) {
lastGlobalProp = p;
result = systemJSPrototype.firstGlobalProp && result || p;
}
else {
foundLastProp = p === lastGlobalProp;
}
cnt++;
lastProp = p;
}
if (lastProp !== lastGlobalProp)
return lastProp;
return result;
}

function noteGlobalProps () {
Expand Down
2 changes: 1 addition & 1 deletion dist/extras/global.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/global.min.js.map

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

33 changes: 26 additions & 7 deletions dist/s.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*
* SJS 6.7.1
* SJS 6.8.0
* Minimal SystemJS Build
*/
(function () {

function errMsg(errCode, msg) {
return (msg || "") + " (SystemJS https://git.io/JvFET#" + errCode + ")";
}
Expand Down Expand Up @@ -464,18 +465,18 @@
execPromise = execPromise.then(function () {
load.C = load.n;
load.E = null; // indicates completion
if (!true) triggerOnload(loader, load, null, true);
if (!true) ;
}, function (err) {
load.er = err;
load.E = null;
if (!true) triggerOnload(loader, load, err, true);
if (!true) ;
else throw err;
});
return load.E = load.E || execPromise;
}
// (should be a promise, but a minify optimization to leave out Promise.resolve)
load.C = load.n;
if (!true) triggerOnload(loader, load, null, true);
if (!true) ;
}
catch (err) {
load.er = err;
Expand Down Expand Up @@ -522,12 +523,27 @@
script.sp = true;
if (!script.src)
return;
System.import(script.src.slice(0, 7) === 'import:' ? script.src.slice(7) : resolveUrl(script.src, baseUrl));
System.import(script.src.slice(0, 7) === 'import:' ? script.src.slice(7) : resolveUrl(script.src, baseUrl)).catch(function (e) {
// if there is a script load error, dispatch an "error" event
// on the script tag.
if (e.message.indexOf('https://git.io/JvFET#3') > -1) {
var event = document.createEvent('Event');
event.initEvent('error', false, false);
script.dispatchEvent(event);
}
return Promise.reject(e);
});
}
else if (script.type === 'systemjs-importmap') {
script.sp = true;
var fetchPromise = script.src ? fetch(script.src, { integrity: script.integrity }).then(function (res) {
if (!res.ok)
throw Error( res.status );
return res.text();
}).catch(function (err) {
err.message = errMsg('W4', script.src ) + '\n' + err.message;
console.warn(err);
return '{}';
}) : script.innerHTML;
importMapPromise = importMapPromise.then(function () {
return fetchPromise;
Expand All @@ -539,10 +555,11 @@
}

function extendImportMap (importMap, newMapText, newMapUrl) {
var newMap = {};
try {
var newMap = JSON.parse(newMapText);
newMap = JSON.parse(newMapText);
} catch (err) {
throw Error( errMsg(1) );
console.warn(Error(( errMsg('W5') )));
}
resolveAndComposeImportMap(newMap, newMapUrl, importMap);
}
Expand Down Expand Up @@ -658,6 +675,8 @@
if (!contentType || !jsContentTypeRegEx.test(contentType))
throw Error(errMsg(4, contentType ));
return res.text().then(function (source) {
if (source.indexOf('//# sourceURL=') < 0)
source += '\n//# sourceURL=' + url;
(0, eval)(source);
return loader.getRegister();
});
Expand Down

0 comments on commit d762870

Please sign in to comment.