Comparing version 3.1.0 to 3.1.1
@@ -0,1 +1,6 @@ | ||
SystemJS 3.1.1 (2019/04/07) | ||
* Fix a Promise chaining bug with top-level await in s.js (https://github.com/systemjs/systemjs/issues/1921, https://github.com/systemjs/systemjs/commits/cc44badb954) | ||
* Support registry iteration (https://github.com/systemjs/systemjs/issues/1918, 984dcd1c0fe, 532fdbddede7c2, 1af0f13f58, @joeldenning) | ||
* Support late loading of import maps (https://github.com/systemjs/systemjs/issues/1916, @joeldenning) | ||
SystemJS 3.1.0 (2019/03/24) | ||
@@ -2,0 +7,0 @@ * Ensure resolve always returns a promise (https://github.com/systemjs/systemjs/commits/42ea052e9a97, @joeldenning) |
/* | ||
* SJS 3.1.0 | ||
* SJS 3.1.1 | ||
* Minimal SystemJS Build | ||
@@ -325,3 +325,3 @@ */ | ||
if (depLoadPromises) { | ||
return load.E = Promise.all(depLoadPromises).then(doExec); | ||
return Promise.all(depLoadPromises).then(doExec); | ||
} | ||
@@ -335,7 +335,6 @@ | ||
if (execPromise) { | ||
execPromise.then(function () { | ||
execPromise = execPromise.then(function () { | ||
load.C = load.n; | ||
load.E = null; | ||
}); | ||
execPromise.catch(function () {}); | ||
}, function () {}); | ||
return load.E = load.E || execPromise; | ||
@@ -342,0 +341,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(){const e="undefined"!=typeof self?self:global;let n;if("undefined"!=typeof location){const e=(n=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==e&&(n=n.slice(0,e+1))}const t=/\\/g,r="undefined"!=typeof Symbol,o=r&&Symbol.toStringTag,i=r?Symbol():"@";function c(){this[i]={}}const l=c.prototype;let u;l.import=function(e,n){const t=this;return Promise.resolve(t.resolve(e,n)).then(function(e){const n=function e(n,t,r){let c=n[i][t];if(c)return c;const l=[],u=Object.create(null);o&&Object.defineProperty(u,o,{value:"Module"});let s=Promise.resolve().then(function(){return n.instantiate(t,r)}).then(function(e){if(!e)throw new Error("Module "+t+" did not instantiate");const r=e[1](function(e,n){c.h=!0;let t=!1;if("object"!=typeof e)e in u&&u[e]===n||(u[e]=n,t=!0);else for(let n in e){let r=e[n];n in u&&u[n]===r||(u[n]=r,t=!0)}if(t)for(let e=0;e<l.length;e++)l[e](u);return n},2===e[1].length?{import:function(e){return n.import(e,t)},meta:n.createContext(t)}:void 0);return c.e=r.execute||function(){},[e[0],r.setters||[]]});const f=s.then(function(r){return Promise.all(r[0].map(function(o,i){const c=r[1][i];return Promise.resolve(n.resolve(o,t)).then(function(r){const o=e(n,r,t);return Promise.resolve(o.I).then(function(){return c&&(o.i.push(c),!o.h&&o.I||c(o.n)),o})})})).then(function(e){c.d=e})});return f.catch(function(e){c.e=null,c.er=e}),c=n[i][t]={id:t,i:l,n:u,I:s,L:f,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(t,e);return n.C||function(e,n){return n.C=function e(n,t,r){if(!r[t.id])return r[t.id]=!0,Promise.resolve(t.L).then(function(){return Promise.all(t.d.map(function(t){return e(n,t,r)}))})}(e,n,{}).then(function(){return function e(n,t,r){if(r[t.id])return;if(r[t.id]=!0,!t.e){if(t.er)throw t.er;return t.E?t.E:void 0}let o;return t.d.forEach(function(t){{const i=e(n,t,r);i&&(o=o||[]).push(i)}}),o?t.E=Promise.all(o).then(i):i();function i(){try{let e=t.e.call(s);if(e)return e.then(function(){t.C=t.n,t.E=null}),e.catch(function(){}),t.E=t.E||e;t.C=t.n}catch(e){throw t.er=e,e}finally{t.L=t.I=void 0,t.e=null}}}(e,n,{})}).then(function(){return n.n})}(t,n)})},l.createContext=function(e){return{url:e}},l.register=function(e,n){u=[e,n]},l.getRegister=function(){const e=u;return u=void 0,e};const s=Object.freeze(Object.create(null));let f;e.System=new c,"undefined"!=typeof window&&window.addEventListener("error",function(e){f=e.error});const d=l.register;l.register=function(e,n){f=void 0,d.call(this,e,n)},l.instantiate=function(e,n){const t=this;return new Promise(function(r,o){const i=document.createElement("script");i.charset="utf-8",i.async=!0,i.crossOrigin="anonymous",i.addEventListener("error",function(){o(new Error("Error loading "+e+(n?" from "+n:"")))}),i.addEventListener("load",function(){if(document.head.removeChild(i),f)return o(f),f=void 0;r(t.getRegister())}),i.src=e,document.head.appendChild(i)})},l.resolve=function(e,r){const o=function(e,n){if(-1!==e.indexOf("\\")&&(e=e.replace(t,"/")),"/"===e[0]&&"/"===e[1])return n.slice(0,n.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){const t=n.slice(0,n.indexOf(":")+1);let r;if(r="/"===n[t.length+1]?"file:"!==t?(r=n.slice(t.length+2)).slice(r.indexOf("/")+1):n.slice(8):n.slice(t.length+("/"===n[t.length])),"/"===e[0])return n.slice(0,n.length-r.length-1)+e;const o=r.slice(0,r.lastIndexOf("/")+1)+e,i=[];let c=-1;for(let e=0;e<o.length;e++)-1!==c?"/"===o[e]&&(i.push(o.slice(c,e+1)),c=-1):"."===o[e]?"."!==o[e+1]||"/"!==o[e+2]&&e+2!==o.length?"/"===o[e+1]||e+1===o.length?e+=1:c=e:(i.pop(),e+=2):c=e;return-1!==c&&i.push(o.slice(c)),n.slice(0,n.length-r.length)+i.join("")}}(e,r||n);if(!o){if(-1!==e.indexOf(":"))return Promise.resolve(e);throw new Error('Cannot resolve "'+e+(r?'" from '+r:'"'))}return Promise.resolve(o)}}(); | ||
!function(){const e="undefined"!=typeof self?self:global;let n;if("undefined"!=typeof location){const e=(n=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==e&&(n=n.slice(0,e+1))}const t=/\\/g,r="undefined"!=typeof Symbol,o=r&&Symbol.toStringTag,i=r?Symbol():"@";function c(){this[i]={}}const l=c.prototype;let u;l.import=function(e,n){const t=this;return Promise.resolve(t.resolve(e,n)).then(function(e){const n=function e(n,t,r){let c=n[i][t];if(c)return c;const l=[],u=Object.create(null);o&&Object.defineProperty(u,o,{value:"Module"});let s=Promise.resolve().then(function(){return n.instantiate(t,r)}).then(function(e){if(!e)throw new Error("Module "+t+" did not instantiate");const r=e[1](function(e,n){c.h=!0;let t=!1;if("object"!=typeof e)e in u&&u[e]===n||(u[e]=n,t=!0);else for(let n in e){let r=e[n];n in u&&u[n]===r||(u[n]=r,t=!0)}if(t)for(let e=0;e<l.length;e++)l[e](u);return n},2===e[1].length?{import:function(e){return n.import(e,t)},meta:n.createContext(t)}:void 0);return c.e=r.execute||function(){},[e[0],r.setters||[]]});const f=s.then(function(r){return Promise.all(r[0].map(function(o,i){const c=r[1][i];return Promise.resolve(n.resolve(o,t)).then(function(r){const o=e(n,r,t);return Promise.resolve(o.I).then(function(){return c&&(o.i.push(c),!o.h&&o.I||c(o.n)),o})})})).then(function(e){c.d=e})});return f.catch(function(e){c.e=null,c.er=e}),c=n[i][t]={id:t,i:l,n:u,I:s,L:f,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(t,e);return n.C||function(e,n){return n.C=function e(n,t,r){if(!r[t.id])return r[t.id]=!0,Promise.resolve(t.L).then(function(){return Promise.all(t.d.map(function(t){return e(n,t,r)}))})}(e,n,{}).then(function(){return function e(n,t,r){if(r[t.id])return;if(r[t.id]=!0,!t.e){if(t.er)throw t.er;return t.E?t.E:void 0}let o;return t.d.forEach(function(t){{const i=e(n,t,r);i&&(o=o||[]).push(i)}}),o?Promise.all(o).then(i):i();function i(){try{let e=t.e.call(s);if(e)return e=e.then(function(){t.C=t.n,t.E=null},function(){}),t.E=t.E||e;t.C=t.n}catch(e){throw t.er=e,e}finally{t.L=t.I=void 0,t.e=null}}}(e,n,{})}).then(function(){return n.n})}(t,n)})},l.createContext=function(e){return{url:e}},l.register=function(e,n){u=[e,n]},l.getRegister=function(){const e=u;return u=void 0,e};const s=Object.freeze(Object.create(null));let f;e.System=new c,"undefined"!=typeof window&&window.addEventListener("error",function(e){f=e.error});const d=l.register;l.register=function(e,n){f=void 0,d.call(this,e,n)},l.instantiate=function(e,n){const t=this;return new Promise(function(r,o){const i=document.createElement("script");i.charset="utf-8",i.async=!0,i.crossOrigin="anonymous",i.addEventListener("error",function(){o(new Error("Error loading "+e+(n?" from "+n:"")))}),i.addEventListener("load",function(){if(document.head.removeChild(i),f)return o(f),f=void 0;r(t.getRegister())}),i.src=e,document.head.appendChild(i)})},l.resolve=function(e,r){const o=function(e,n){if(-1!==e.indexOf("\\")&&(e=e.replace(t,"/")),"/"===e[0]&&"/"===e[1])return n.slice(0,n.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){const t=n.slice(0,n.indexOf(":")+1);let r;if(r="/"===n[t.length+1]?"file:"!==t?(r=n.slice(t.length+2)).slice(r.indexOf("/")+1):n.slice(8):n.slice(t.length+("/"===n[t.length])),"/"===e[0])return n.slice(0,n.length-r.length-1)+e;const o=r.slice(0,r.lastIndexOf("/")+1)+e,i=[];let c=-1;for(let e=0;e<o.length;e++)-1!==c?"/"===o[e]&&(i.push(o.slice(c,e+1)),c=-1):"."===o[e]?"."!==o[e+1]||"/"!==o[e+2]&&e+2!==o.length?"/"===o[e+1]||e+1===o.length?e+=1:c=e:(i.pop(),e+=2):c=e;return-1!==c&&i.push(o.slice(c)),n.slice(0,n.length-r.length)+i.join("")}}(e,r||n);if(!o){if(-1!==e.indexOf(":"))return Promise.resolve(e);throw new Error('Cannot resolve "'+e+(r?'" from '+r:'"'))}return Promise.resolve(o)}}(); |
/* | ||
* SystemJS 3.1.0 | ||
* SystemJS 3.1.1 | ||
*/ | ||
@@ -443,3 +443,2 @@ (function () { | ||
}); | ||
execPromise.catch(function () {}); | ||
return load.E = load.E || execPromise; | ||
@@ -673,25 +672,10 @@ } | ||
let importMapPromise = Promise.resolve(baseMap); | ||
let acquiringImportMaps = typeof document !== 'undefined'; | ||
if (typeof document !== 'undefined') { | ||
const importMapScripts = document.querySelectorAll('script[type="systemjs-importmap"]'); | ||
for (let i = 0; i < importMapScripts.length; i++) { | ||
const script = importMapScripts[i]; | ||
if (!script.src) { | ||
importMapPromise = importMapPromise.then(function (map) { | ||
return mergeImportMap(map, parseImportMap(JSON.parse(script.innerHTML), baseUrl)); | ||
}); | ||
} | ||
else { | ||
const fetchPromise = fetch(script.src); | ||
importMapPromise = importMapPromise.then(function (map) { | ||
return fetchPromise | ||
.then(function (res) { | ||
return res.json(); | ||
}) | ||
.then(function (data) { | ||
return mergeImportMap(map, parseImportMap(data, script.src)); | ||
}); | ||
}); | ||
} | ||
} | ||
if (acquiringImportMaps) { | ||
document.querySelectorAll('script[type="systemjs-importmap"][src]').forEach(function (script) { | ||
script._j = fetch(script.src).then(function (resp) { | ||
return resp.json(); | ||
}); | ||
}); | ||
} | ||
@@ -712,2 +696,14 @@ | ||
if (acquiringImportMaps) { | ||
acquiringImportMaps = false; | ||
document.querySelectorAll('script[type="systemjs-importmap"]').forEach(function (script) { | ||
importMapPromise = importMapPromise.then(function (map) { | ||
return (script._j || script.src && fetch(script.src).then(function (resp) {return resp.json()}) || Promise.resolve(JSON.parse(script.innerHTML))) | ||
.then(function (json) { | ||
return mergeImportMap(map, parseImportMap(json, script.src || baseUrl)); | ||
}); | ||
}); | ||
}); | ||
} | ||
return importMapPromise | ||
@@ -779,2 +775,22 @@ .then(function (importMap) { | ||
const iterator = typeof Symbol !== 'undefined' && Symbol.iterator; | ||
systemJSPrototype.entries = function () { | ||
const loader = this, keys = Object.keys(loader[REGISTRY]); | ||
let index = 0, ns, key; | ||
return { | ||
next () { | ||
while ( | ||
(key = keys[index++]) !== undefined && | ||
(ns = loader.get(key)) === undefined | ||
); | ||
return { | ||
done: key === undefined, | ||
value: key !== undefined && [key, ns] | ||
}; | ||
}, | ||
[iterator]: function() { return this } | ||
}; | ||
}; | ||
}()); |
/* | ||
* SystemJS 3.1.0 | ||
* SystemJS 3.1.1 | ||
*/ | ||
!function(){const t="undefined"!=typeof self,n=t?self:global;let e;if("undefined"!=typeof location){const t=(e=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==t&&(e=e.slice(0,t+1))}const o=/\\/g;function r(t,n){if(-1!==t.indexOf("\\")&&(t=t.replace(o,"/")),"/"===t[0]&&"/"===t[1])return n.slice(0,n.indexOf(":")+1)+t;if("."===t[0]&&("/"===t[1]||"."===t[1]&&("/"===t[2]||2===t.length&&(t+="/"))||1===t.length&&(t+="/"))||"/"===t[0]){const e=n.slice(0,n.indexOf(":")+1);let o;if(o="/"===n[e.length+1]?"file:"!==e?(o=n.slice(e.length+2)).slice(o.indexOf("/")+1):n.slice(8):n.slice(e.length+("/"===n[e.length])),"/"===t[0])return n.slice(0,n.length-o.length-1)+t;const r=o.slice(0,o.lastIndexOf("/")+1)+t,i=[];let c=-1;for(let t=0;t<r.length;t++)-1!==c?"/"===r[t]&&(i.push(r.slice(c,t+1)),c=-1):"."===r[t]?"."!==r[t+1]||"/"!==r[t+2]&&t+2!==r.length?"/"===r[t+1]||t+1===r.length?t+=1:c=t:(i.pop(),t+=2):c=t;return-1!==c&&i.push(r.slice(c)),n.slice(0,n.length-o.length)+i.join("")}}function i(t,n){return r(t,n)||-1!==t.indexOf(":")&&t||r("./"+t,n)}function c(t,n){var e={};for(var o in t){var c=t[o];"string"==typeof c&&(e[r(o,n)||o]=i(c,n))}return e}function s(t,n){const e=c(t.imports,n)||{},o={};if(t.scopes)for(let e in t.scopes){const r=t.scopes[e];let s=i(e,n);"/"!==s[s.length-1]&&(s+="/"),o[s]=c(r,s)||{}}return{imports:e,scopes:o}}function u(t,n){if(n[t])return t;let e=t.length;do{const o=t.slice(0,e+1);if(o in n)return o}while(-1!==(e=t.lastIndexOf("/",e-1)))}function l(t,n){const e=u(t,n);if(e){const o=n[e];return null===o&&t.length>e.length&&"/"!==o[o.length-1]&&console.warn("Invalid package target "+o+" for '"+e+"' should have a trailing '/'."),o+t.slice(e.length)}}const f="undefined"!=typeof Symbol,d=f&&Symbol.toStringTag,a=f?Symbol():"@";function h(){this[a]={}}const p=h.prototype;let m;p.import=function(t,n){const e=this;return Promise.resolve(e.resolve(t,n)).then(function(t){const n=function t(n,e,o){let r=n[a][e];if(r)return r;const i=[],c=Object.create(null);d&&Object.defineProperty(c,d,{value:"Module"});let s=Promise.resolve().then(function(){return n.instantiate(e,o)}).then(function(t){if(!t)throw new Error("Module "+e+" did not instantiate");const o=t[1](function(t,n){r.h=!0;let e=!1;if("object"!=typeof t)t in c&&c[t]===n||(c[t]=n,e=!0);else for(let n in t){let o=t[n];n in c&&c[n]===o||(c[n]=o,e=!0)}if(e)for(let t=0;t<i.length;t++)i[t](c);return n},2===t[1].length?{import:function(t){return n.import(t,e)},meta:n.createContext(e)}:void 0);return r.e=o.execute||function(){},[t[0],o.setters||[]]});const u=(s=s.catch(function(t){throw n.onload(r.id,t),t})).then(function(o){return Promise.all(o[0].map(function(r,i){const c=o[1][i];return Promise.resolve(n.resolve(r,e)).then(function(o){const r=t(n,o,e);return Promise.resolve(r.I).then(function(){return c&&(r.i.push(c),!r.h&&r.I||c(r.n)),r})})})).then(function(t){r.d=t})});return u.catch(function(t){r.e=null,r.er=t}),r=n[a][e]={id:e,i:i,n:c,I:s,L:u,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(e,t);return n.C||function(t,n){return n.C=function t(n,e,o){if(!o[e.id])return o[e.id]=!0,Promise.resolve(e.L).then(function(){return Promise.all(e.d.map(function(e){return t(n,e,o)}))})}(t,n,{}).then(function(){return function t(n,e,o){if(o[e.id])return;if(o[e.id]=!0,!e.e){if(e.er)throw e.er;return e.E?e.E:void 0}let r;return e.d.forEach(function(i){try{const c=t(n,i,o);c&&(r=r||[]).push(c)}catch(t){throw n.onload(e.id,t),t}}),r?Promise.all(r).then(i).catch(function(t){throw n.onload(e.id,t),t}):i();function i(){try{let t=e.e.call(g);if(t)return(t=t.then(function(){e.C=e.n,e.E=null,n.onload(e.id,null)},function(t){throw n.onload(e.id,t),t})).catch(function(){}),e.E=e.E||t;e.C=e.n,n.onload(e.id,null)}catch(t){throw n.onload(e.id,t),e.er=t,t}finally{e.L=e.I=void 0,e.e=null}}}(t,n,{})}).then(function(){return n.n})}(e,n)})},p.createContext=function(t){return{url:t}},p.onload=function(){},p.register=function(t,n){m=[t,n]},p.getRegister=function(){const t=m;return m=void 0,t};const g=Object.freeze(Object.create(null));let y;n.System=new h,"undefined"!=typeof window&&window.addEventListener("error",function(t){y=t.error});const v=p.register;p.register=function(t,n){y=void 0,v.call(this,t,n)},p.instantiate=function(t,n){const e=this;return new Promise(function(o,r){const i=document.createElement("script");i.charset="utf-8",i.async=!0,i.crossOrigin="anonymous",i.addEventListener("error",function(){r(new Error("Error loading "+t+(n?" from "+n:"")))}),i.addEventListener("load",function(){if(document.head.removeChild(i),y)return r(y),y=void 0;o(e.getRegister())}),i.src=t,document.head.appendChild(i)})},t&&"function"==typeof importScripts&&(p.instantiate=function(t){const n=this;return new Promise(function(e,o){try{importScripts(t)}catch(t){o(t)}e(n.getRegister())})}),function(t){const n=System.constructor.prototype;let e,o,r;const i=n.import;n.import=function(n,c){return function(){e=o=void 0;for(let n in t)t.hasOwnProperty(n)&&(e?o||(o=n):e=n,r=n)}(),i.call(this,n,c)};const c=[[],function(){return{}}],s=n.getRegister;n.getRegister=function(){const n=s.call(this);if(n)return n;const i=function(){let n,i=0;for(let r in t)if(t.hasOwnProperty(r)){if(0===i&&r!==e||1===i&&r!==o)return r;i++,n=r}if(n!==r)return n}();if(!i)return c;let u;try{u=t[i]}catch(t){return c}return[[],function(t){return{execute:function(){t("default",u)}}}]}}("undefined"!=typeof self?self:global);const b=p.instantiate;p.instantiate=function(t,n){return".wasm"!==t.slice(-5)?b.call(this,t,n):fetch(t).then(function(t){if(!t.ok)throw new Error(t.status+" "+t.statusText+" "+t.url+(n?" loading from "+n:""));return WebAssembly.compileStreaming?WebAssembly.compileStreaming(t):t.arrayBuffer().then(function(t){return WebAssembly.compile(t)})}).then(function(t){const n=[],e=[],o={};return WebAssembly.Module.imports&&WebAssembly.Module.imports(t).forEach(function(t){const r=t.module;e.push(function(t){o[r]=t}),-1===n.indexOf(r)&&n.push(r)}),[n,function(n){return{setters:e,execute:function(){return WebAssembly.instantiate(t,o).then(function(t){n(t.exports)})}}}]})};const w=Object.create(null);w.imports=Object.create(null),w.scopes=Object.create(null);let O=Promise.resolve(w);if("undefined"!=typeof document){const t=document.querySelectorAll('script[type="systemjs-importmap"]');for(let n=0;n<t.length;n++){const o=t[n];if(o.src){const t=fetch(o.src);O=O.then(function(n){return t.then(function(t){return t.json()}).then(function(t){return E(n,s(t,o.src))})})}else O=O.then(function(t){return E(t,s(JSON.parse(o.innerHTML),e))})}}function E(t,n){for(let e in n.imports)t.imports[e]=n.imports[e];for(let e in n.scopes)t.scopes[e]=n.scopes[e];return t}p.resolve=function(t,n){return n=n||e,O.then(function(e){return function(t,n,e){const o=r(t,n)||-1!==t.indexOf(":")&&t;o&&(t=o);const i=u(n,e.scopes);if(i){const n=l(t,e.scopes[i]);if(n)return n}return l(t,e.imports)||o||function(t,n){throw new Error('Unable to resolve bare specifier "'+t+(n?'" from '+n:'"'))}(t,n)}(t,n,e)})};const x="undefined"!=typeof Symbol&&Symbol.toStringTag;p.get=function(t){const n=this[a][t];if(n&&null===n.e&&!n.E)return n.er?null:n.n},p.set=function(t,n){let e;x&&"Module"===n[x]?e=n:(e=Object.assign(Object.create(null),n),x&&Object.defineProperty(e,x,{value:"Module"}));const o=Promise.resolve(e);return this.delete(t),this[a][t]={id:t,i:[],n:e,I:o,L:o,h:!1,d:[],e:null,er:void 0,E:void 0,C:o},e},p.has=function(t){const n=this[a][t];return n&&null===n.e&&!n.E},p.delete=function(t){const n=this.get(t);return void 0!==n&&(n&&n.d&&n.d.forEach(function(t){const e=t.i.indexOf(n);-1!==e&&t.i.splice(e,1)}),delete this[a][t])}}(); | ||
!function(){const t="undefined"!=typeof self,n=t?self:global;let e;if("undefined"!=typeof location){const t=(e=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==t&&(e=e.slice(0,t+1))}const o=/\\/g;function r(t,n){if(-1!==t.indexOf("\\")&&(t=t.replace(o,"/")),"/"===t[0]&&"/"===t[1])return n.slice(0,n.indexOf(":")+1)+t;if("."===t[0]&&("/"===t[1]||"."===t[1]&&("/"===t[2]||2===t.length&&(t+="/"))||1===t.length&&(t+="/"))||"/"===t[0]){const e=n.slice(0,n.indexOf(":")+1);let o;if(o="/"===n[e.length+1]?"file:"!==e?(o=n.slice(e.length+2)).slice(o.indexOf("/")+1):n.slice(8):n.slice(e.length+("/"===n[e.length])),"/"===t[0])return n.slice(0,n.length-o.length-1)+t;const r=o.slice(0,o.lastIndexOf("/")+1)+t,i=[];let c=-1;for(let t=0;t<r.length;t++)-1!==c?"/"===r[t]&&(i.push(r.slice(c,t+1)),c=-1):"."===r[t]?"."!==r[t+1]||"/"!==r[t+2]&&t+2!==r.length?"/"===r[t+1]||t+1===r.length?t+=1:c=t:(i.pop(),t+=2):c=t;return-1!==c&&i.push(r.slice(c)),n.slice(0,n.length-o.length)+i.join("")}}function i(t,n){return r(t,n)||-1!==t.indexOf(":")&&t||r("./"+t,n)}function c(t,n){var e={};for(var o in t){var c=t[o];"string"==typeof c&&(e[r(o,n)||o]=i(c,n))}return e}function s(t,n){if(n[t])return t;let e=t.length;do{const o=t.slice(0,e+1);if(o in n)return o}while(-1!==(e=t.lastIndexOf("/",e-1)))}function u(t,n){const e=s(t,n);if(e){const o=n[e];return null===o&&t.length>e.length&&"/"!==o[o.length-1]&&console.warn("Invalid package target "+o+" for '"+e+"' should have a trailing '/'."),o+t.slice(e.length)}}const l="undefined"!=typeof Symbol,f=l&&Symbol.toStringTag,d=l?Symbol():"@";function a(){this[d]={}}const h=a.prototype;let p;h.import=function(t,n){const e=this;return Promise.resolve(e.resolve(t,n)).then(function(t){const n=function t(n,e,o){let r=n[d][e];if(r)return r;const i=[],c=Object.create(null);f&&Object.defineProperty(c,f,{value:"Module"});let s=Promise.resolve().then(function(){return n.instantiate(e,o)}).then(function(t){if(!t)throw new Error("Module "+e+" did not instantiate");const o=t[1](function(t,n){r.h=!0;let e=!1;if("object"!=typeof t)t in c&&c[t]===n||(c[t]=n,e=!0);else for(let n in t){let o=t[n];n in c&&c[n]===o||(c[n]=o,e=!0)}if(e)for(let t=0;t<i.length;t++)i[t](c);return n},2===t[1].length?{import:function(t){return n.import(t,e)},meta:n.createContext(e)}:void 0);return r.e=o.execute||function(){},[t[0],o.setters||[]]});const u=(s=s.catch(function(t){throw n.onload(r.id,t),t})).then(function(o){return Promise.all(o[0].map(function(r,i){const c=o[1][i];return Promise.resolve(n.resolve(r,e)).then(function(o){const r=t(n,o,e);return Promise.resolve(r.I).then(function(){return c&&(r.i.push(c),!r.h&&r.I||c(r.n)),r})})})).then(function(t){r.d=t})});return u.catch(function(t){r.e=null,r.er=t}),r=n[d][e]={id:e,i:i,n:c,I:s,L:u,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(e,t);return n.C||function(t,n){return n.C=function t(n,e,o){if(!o[e.id])return o[e.id]=!0,Promise.resolve(e.L).then(function(){return Promise.all(e.d.map(function(e){return t(n,e,o)}))})}(t,n,{}).then(function(){return function t(n,e,o){if(o[e.id])return;if(o[e.id]=!0,!e.e){if(e.er)throw e.er;return e.E?e.E:void 0}let r;return e.d.forEach(function(i){try{const c=t(n,i,o);c&&(r=r||[]).push(c)}catch(t){throw n.onload(e.id,t),t}}),r?Promise.all(r).then(i).catch(function(t){throw n.onload(e.id,t),t}):i();function i(){try{let t=e.e.call(m);if(t)return t=t.then(function(){e.C=e.n,e.E=null,n.onload(e.id,null)},function(t){throw n.onload(e.id,t),t}),e.E=e.E||t;e.C=e.n,n.onload(e.id,null)}catch(t){throw n.onload(e.id,t),e.er=t,t}finally{e.L=e.I=void 0,e.e=null}}}(t,n,{})}).then(function(){return n.n})}(e,n)})},h.createContext=function(t){return{url:t}},h.onload=function(){},h.register=function(t,n){p=[t,n]},h.getRegister=function(){const t=p;return p=void 0,t};const m=Object.freeze(Object.create(null));let g;n.System=new a,"undefined"!=typeof window&&window.addEventListener("error",function(t){g=t.error});const y=h.register;h.register=function(t,n){g=void 0,y.call(this,t,n)},h.instantiate=function(t,n){const e=this;return new Promise(function(o,r){const i=document.createElement("script");i.charset="utf-8",i.async=!0,i.crossOrigin="anonymous",i.addEventListener("error",function(){r(new Error("Error loading "+t+(n?" from "+n:"")))}),i.addEventListener("load",function(){if(document.head.removeChild(i),g)return r(g),g=void 0;o(e.getRegister())}),i.src=t,document.head.appendChild(i)})},t&&"function"==typeof importScripts&&(h.instantiate=function(t){const n=this;return new Promise(function(e,o){try{importScripts(t)}catch(t){o(t)}e(n.getRegister())})}),function(t){const n=System.constructor.prototype;let e,o,r;const i=n.import;n.import=function(n,c){return function(){e=o=void 0;for(let n in t)t.hasOwnProperty(n)&&(e?o||(o=n):e=n,r=n)}(),i.call(this,n,c)};const c=[[],function(){return{}}],s=n.getRegister;n.getRegister=function(){const n=s.call(this);if(n)return n;const i=function(){let n,i=0;for(let r in t)if(t.hasOwnProperty(r)){if(0===i&&r!==e||1===i&&r!==o)return r;i++,n=r}if(n!==r)return n}();if(!i)return c;let u;try{u=t[i]}catch(t){return c}return[[],function(t){return{execute:function(){t("default",u)}}}]}}("undefined"!=typeof self?self:global);const v=h.instantiate;h.instantiate=function(t,n){return".wasm"!==t.slice(-5)?v.call(this,t,n):fetch(t).then(function(t){if(!t.ok)throw new Error(t.status+" "+t.statusText+" "+t.url+(n?" loading from "+n:""));return WebAssembly.compileStreaming?WebAssembly.compileStreaming(t):t.arrayBuffer().then(function(t){return WebAssembly.compile(t)})}).then(function(t){const n=[],e=[],o={};return WebAssembly.Module.imports&&WebAssembly.Module.imports(t).forEach(function(t){const r=t.module;e.push(function(t){o[r]=t}),-1===n.indexOf(r)&&n.push(r)}),[n,function(n){return{setters:e,execute:function(){return WebAssembly.instantiate(t,o).then(function(t){n(t.exports)})}}}]})};const b=Object.create(null);b.imports=Object.create(null),b.scopes=Object.create(null);let O=Promise.resolve(b),w="undefined"!=typeof document;w&&document.querySelectorAll('script[type="systemjs-importmap"][src]').forEach(function(t){t._j=fetch(t.src).then(function(t){return t.json()})}),h.resolve=function(t,n){return n=n||e,w&&(w=!1,document.querySelectorAll('script[type="systemjs-importmap"]').forEach(function(t){O=O.then(function(n){return(t._j||t.src&&fetch(t.src).then(function(t){return t.json()})||Promise.resolve(JSON.parse(t.innerHTML))).then(function(o){return function(t,n){for(let e in n.imports)t.imports[e]=n.imports[e];for(let e in n.scopes)t.scopes[e]=n.scopes[e];return t}(n,function(t,n){const e=c(t.imports,n)||{},o={};if(t.scopes)for(let e in t.scopes){const r=t.scopes[e];let s=i(e,n);"/"!==s[s.length-1]&&(s+="/"),o[s]=c(r,s)||{}}return{imports:e,scopes:o}}(o,t.src||e))})})})),O.then(function(e){return function(t,n,e){const o=r(t,n)||-1!==t.indexOf(":")&&t;o&&(t=o);const i=s(n,e.scopes);if(i){const n=u(t,e.scopes[i]);if(n)return n}return u(t,e.imports)||o||function(t,n){throw new Error('Unable to resolve bare specifier "'+t+(n?'" from '+n:'"'))}(t,n)}(t,n,e)})};const E="undefined"!=typeof Symbol&&Symbol.toStringTag;h.get=function(t){const n=this[d][t];if(n&&null===n.e&&!n.E)return n.er?null:n.n},h.set=function(t,n){let e;E&&"Module"===n[E]?e=n:(e=Object.assign(Object.create(null),n),E&&Object.defineProperty(e,E,{value:"Module"}));const o=Promise.resolve(e);return this.delete(t),this[d][t]={id:t,i:[],n:e,I:o,L:o,h:!1,d:[],e:null,er:void 0,E:void 0,C:o},e},h.has=function(t){const n=this[d][t];return n&&null===n.e&&!n.E},h.delete=function(t){const n=this.get(t);return void 0!==n&&(n&&n.d&&n.d.forEach(function(t){const e=t.i.indexOf(n);-1!==e&&t.i.splice(e,1)}),delete this[d][t])};const j="undefined"!=typeof Symbol&&Symbol.iterator;h.entries=function(){const t=this,n=Object.keys(t[d]);let e,o,r=0;return{next(){for(;void 0!==(o=n[r++])&&void 0===(e=t.get(o)););return{done:void 0===o,value:void 0!==o&&[o,e]}},[j]:function(){return this}}}}(); |
{ | ||
"name": "systemjs", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Dynamic ES module loader", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -85,3 +85,3 @@ # SystemJS | ||
```html | ||
<script src="system.js"></script> | ||
<script type="systemjs-importmap"> | ||
@@ -97,4 +97,2 @@ { | ||
--> | ||
<!-- SystemJS must be loaded after the import map --> | ||
<script src="system.js"></script> | ||
<script> | ||
@@ -101,0 +99,0 @@ System.import('/js/main.js'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102185
1378
193
8