diff options
Diffstat (limited to 'node_modules/systemjs/dist/system.src.js')
-rw-r--r-- | node_modules/systemjs/dist/system.src.js | 68 |
1 files changed, 28 insertions, 40 deletions
diff --git a/node_modules/systemjs/dist/system.src.js b/node_modules/systemjs/dist/system.src.js index 4cac0d0fc..13dbc2fe5 100644 --- a/node_modules/systemjs/dist/system.src.js +++ b/node_modules/systemjs/dist/system.src.js @@ -1,5 +1,5 @@ /* - * SystemJS v0.19.40 + * SystemJS v0.19.41 */ (function() { function bootstrap() {// from https://gist.github.com/Yaffle/1088850 @@ -1627,7 +1627,7 @@ function prepareBaseURL(loader) { if (this._loader.baseURL !== this.baseURL) { if (this.baseURL[this.baseURL.length - 1] != '/') this.baseURL += '/'; - + this._loader.baseURL = this.baseURL = new URL(this.baseURL, baseURIObj).href; } } @@ -1729,7 +1729,7 @@ function coreResolve(name, parentName) { if (this.has(name)) return name; - + // dynamically load node-core modules when requiring `@node/fs` for example if (name.substr(0, 6) == '@node/') { if (!this._nodeRequire) @@ -1782,7 +1782,7 @@ hook('fetch', function() { /* __useDefault - + When a module object looks like: newModule( __useDefault: true, @@ -1972,7 +1972,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { if (this.warnings) { for (var p in loader.paths) if (p.indexOf('*') != -1) - warn.call(loader, 'Paths configuration "' + p + '" -> "' + loader.paths[p] + '" uses wildcards which are being deprecated for simpler trailing "/" folder paths.'); + warn.call(loader, 'Paths configuration "' + p + '" -> "' + loader.paths[p] + '" uses wildcards which are being deprecated for just leaving a trailing "/" to indicate folder paths.'); } } @@ -1985,14 +1985,11 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { loader.pluginFirst = cfg.pluginFirst; if (cfg.map) { - var objMaps = ''; for (var p in cfg.map) { var v = cfg.map[p]; // object map backwards-compat into packages configuration if (typeof v !== 'string') { - objMaps += (objMaps.length ? ', ' : '') + '"' + p + '"'; - var defaultJSExtension = loader.defaultJSExtensions && p.substr(p.length - 3, 3) != '.js'; var prop = loader.decanonicalize(p); if (defaultJSExtension && prop.substr(prop.length - 3, 3) == '.js') @@ -2001,8 +1998,8 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { // if a package main, revert it var pkgMatch = ''; for (var pkg in loader.packages) { - if (prop.substr(0, pkg.length) == pkg - && (!prop[pkg.length] || prop[pkg.length] == '/') + if (prop.substr(0, pkg.length) == pkg + && (!prop[pkg.length] || prop[pkg.length] == '/') && pkgMatch.split('/').length < pkg.split('/').length) pkgMatch = pkg; } @@ -2016,8 +2013,6 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { loader.map[p] = v; } } - if (objMaps) - warn.call(loader, 'The map configuration for ' + objMaps + ' uses object submaps, which is deprecated in global map.\nUpdate this to use package contextual map with configs like SystemJS.config({ packages: { "' + p + '": { map: {...} } } }).'); } if (cfg.packageConfigPaths) { @@ -2063,7 +2058,7 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { for (var c in cfg) { var v = cfg[c]; - if (indexOf.call(['baseURL', 'map', 'packages', 'bundles', 'paths', 'warnings', 'packageConfigPaths', + if (indexOf.call(['baseURL', 'map', 'packages', 'bundles', 'paths', 'warnings', 'packageConfigPaths', 'loaderErrorStack', 'browserConfig', 'nodeConfig', 'devConfig', 'buildConfig', 'productionConfig'], c) != -1) continue; @@ -2102,7 +2097,8 @@ SystemJSLoader.prototype.config = function(cfg, isEnvConfig) { envSet(loader, cfg, function(cfg) { loader.config(cfg, true); }); -};/* +}; +/* * Package Configuration Extension * * Example: @@ -3573,14 +3569,7 @@ function createEntry() { // do transpilation return (loader._loader.transpilerPromise || ( loader._loader.transpilerPromise = Promise.resolve( - __global[loader.transpiler == 'typescript' ? 'ts' : loader.transpiler] || (loader.pluginLoader || loader).normalize(loader.transpiler) - .then(function(normalized) { - loader._loader.transpilerNormalized = normalized; - return (loader.pluginLoader || loader).load(normalized) - .then(function() { - return (loader.pluginLoader || loader).get(normalized); - }); - }) + __global[loader.transpiler == 'typescript' ? 'ts' : loader.transpiler] || (loader.pluginLoader || loader)['import'](loader.transpiler) ))).then(function(transpiler) { loader._loader.loadedTranspilerRuntime = true; @@ -3589,8 +3578,6 @@ function createEntry() { // if transpiler is the same as the plugin loader, then don't run twice if (transpiler == load.metadata.loaderModule) return load.source; - load.metadata.loaderModule = transpiler; - load.metadata.loader = loader._loader.transpilerNormalized; // convert the source map into an object for transpilation chaining if (typeof load.metadata.sourceMap == 'string') @@ -3602,7 +3589,7 @@ function createEntry() { var sourceMap = load.metadata.sourceMap; if (sourceMap && typeof sourceMap == 'object') { var originalName = load.address.split('!')[0]; - + // force set the filename of the original file if (!sourceMap.file || sourceMap.file == load.address) sourceMap.file = originalName + '!transpiled'; @@ -3621,14 +3608,14 @@ function createEntry() { // legacy builder support if (loader.builder) load.metadata.originalSource = load.source; - + // defined in es6-module-loader/src/transpile.js return transpile.call(loader, load) .then(function(source) { // clear sourceMap as transpiler embeds it load.metadata.sourceMap = undefined; return source; - }); + }); }, function(err) { throw addToError(err, 'Unable to load transpiler to transpile ' + load.name); }); @@ -4439,13 +4426,13 @@ hookConstructor(function(constructor) { // if so, remove for backwards compat // this is strange and sucks, but will be deprecated function checkDefaultExtension(loader, arg) { - return loader.defaultJSExtensions && arg.substr(arg.length - 3, 3) != '.js'; + return loader.defaultJSExtensions && arg.substr(arg.length - 3, 3) != '.js'; } function createNormalizeSync(normalizeSync) { return function(name, parentName, isPlugin) { var loader = this; - + var parsed = parsePlugin(loader, name); parentName = getParentName(this, parentName); @@ -4458,7 +4445,7 @@ hookConstructor(function(constructor) { return combinePluginParts(loader, argumentName, pluginName, checkDefaultExtension(loader, parsed.argument)); }; } - + hook('decanonicalize', createNormalizeSync); hook('normalizeSync', createNormalizeSync); @@ -4578,7 +4565,7 @@ hookConstructor(function(constructor) { throw new Error('load.metadata.sourceMap must be set to an object.'); var originalName = load.address.split('!')[0]; - + // force set the filename of the original file if (!sourceMap.file || sourceMap.file == load.address) sourceMap.file = originalName + '!transpiled'; @@ -4593,8 +4580,6 @@ hookConstructor(function(constructor) { if (typeof result == 'string') load.source = result; - else - warn.call(this, 'Plugin ' + load.metadata.loader + ' should return the source in translate, instead of setting load.source directly. This support will be deprecated.'); return translate.apply(loader, args); }); @@ -4620,12 +4605,14 @@ hookConstructor(function(constructor) { if (calledInstantiate) return result; - load.metadata.entry = createEntry(); - load.metadata.entry.execute = function() { - return result; + if (result !== undefined) { + load.metadata.entry = createEntry(); + load.metadata.entry.execute = function() { + return result; + } + load.metadata.entry.deps = load.metadata.deps; + load.metadata.format = 'defined'; } - load.metadata.entry.deps = load.metadata.deps; - load.metadata.format = 'defined'; return instantiate.call(loader, load); }); else @@ -4633,7 +4620,8 @@ hookConstructor(function(constructor) { }; }); -})();/* +})(); +/* * Conditions Extension * * Allows a condition module to alter the resolution of an import via syntax: @@ -5106,7 +5094,7 @@ hookConstructor(function(constructor) { System = new SystemJSLoader(); __global.SystemJS = System; -System.version = '0.19.40 Standard'; +System.version = '0.19.41 Standard'; if (typeof module == 'object' && module.exports && typeof exports == 'object') module.exports = System; |