Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit 81d0471

Browse files
committed
v0.17.1
1 parent e4ac34d commit 81d0471

7 files changed

+29
-24
lines changed

dist/es6-module-loader-dev.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader-dev.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader-dev.src.js

+18-11
Original file line numberDiff line numberDiff line change
@@ -992,15 +992,24 @@ function logloads(loads) {
992992
// By disaling this module write-protection we gain performance.
993993
// It could be useful to allow an option to enable or disable this.
994994
module.locked = true;
995-
moduleObj[name] = value;
995+
996+
// export({name: value})
997+
if (typeof name == 'object') {
998+
for (var p in name)
999+
moduleObj[p] = name[p];
1000+
}
1001+
// export(name, value)
1002+
else {
1003+
moduleObj[name] = value;
1004+
}
9961005

9971006
for (var i = 0, l = module.importers.length; i < l; i++) {
9981007
var importerModule = module.importers[i];
9991008
if (!importerModule.locked) {
1000-
for (var j = 0; j < importerModule.dependencies.length; ++j) {
1001-
if (importerModule.dependencies[j] === module) {
1002-
importerModule.setters[j](moduleObj);
1003-
}
1009+
for (var j = 0; j < importerModule.dependencies.length; ++j) {
1010+
if (importerModule.dependencies[j] === module) {
1011+
importerModule.setters[j](moduleObj);
1012+
}
10041013
}
10051014
}
10061015
}
@@ -1312,12 +1321,12 @@ function SystemLoader() {
13121321
}
13131322

13141323
// NB no specification provided for System.paths, used ideas discussed in https://github.com/jorendorff/js-loaders/issues/25
1315-
function applyPaths(loader, name) {
1324+
function applyPaths(paths, name) {
13161325
// most specific (most number of slashes in path) match wins
13171326
var pathMatch = '', wildcard, maxSlashCount = 0;
13181327

13191328
// check to see if we have a paths entry
1320-
for (var p in loader.paths) {
1329+
for (var p in paths) {
13211330
var pathParts = p.split('*');
13221331
if (pathParts.length > 2)
13231332
throw new TypeError('Only one wildcard in a path is permitted');
@@ -1342,7 +1351,7 @@ function applyPaths(loader, name) {
13421351
}
13431352
}
13441353

1345-
var outPath = loader.paths[pathMatch] || name;
1354+
var outPath = paths[pathMatch] || name;
13461355
if (wildcard)
13471356
outPath = outPath.replace('*', wildcard);
13481357

@@ -1354,8 +1363,6 @@ function LoaderProto() {}
13541363
LoaderProto.prototype = Loader.prototype;
13551364
SystemLoader.prototype = new LoaderProto();
13561365

1357-
var baseURLCache = {};
1358-
13591366
var absURLRegEx = /^([^\/]+:\/\/|\/)/;
13601367

13611368
// Normalization with module names as absolute URLs
@@ -1366,7 +1373,7 @@ SystemLoader.prototype.normalize = function(name, parentName, parentAddress) {
13661373

13671374
// not absolute or relative -> apply paths (what will be sites)
13681375
if (!name.match(absURLRegEx) && name[0] != '.')
1369-
name = new URL(applyPaths(this, name), baseURI).href;
1376+
name = new URL(applyPaths(this.paths, name), baseURI).href;
13701377
// apply parent-relative normalization, parentAddress is already normalized
13711378
else
13721379
name = new URL(name, parentName || baseURI).href;

dist/es6-module-loader.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/es6-module-loader.src.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -979,12 +979,12 @@ function SystemLoader() {
979979
}
980980

981981
// NB no specification provided for System.paths, used ideas discussed in https://github.com/jorendorff/js-loaders/issues/25
982-
function applyPaths(loader, name) {
982+
function applyPaths(paths, name) {
983983
// most specific (most number of slashes in path) match wins
984984
var pathMatch = '', wildcard, maxSlashCount = 0;
985985

986986
// check to see if we have a paths entry
987-
for (var p in loader.paths) {
987+
for (var p in paths) {
988988
var pathParts = p.split('*');
989989
if (pathParts.length > 2)
990990
throw new TypeError('Only one wildcard in a path is permitted');
@@ -1009,7 +1009,7 @@ function applyPaths(loader, name) {
10091009
}
10101010
}
10111011

1012-
var outPath = loader.paths[pathMatch] || name;
1012+
var outPath = paths[pathMatch] || name;
10131013
if (wildcard)
10141014
outPath = outPath.replace('*', wildcard);
10151015

@@ -1021,8 +1021,6 @@ function LoaderProto() {}
10211021
LoaderProto.prototype = Loader.prototype;
10221022
SystemLoader.prototype = new LoaderProto();
10231023

1024-
var baseURLCache = {};
1025-
10261024
var absURLRegEx = /^([^\/]+:\/\/|\/)/;
10271025

10281026
// Normalization with module names as absolute URLs
@@ -1033,7 +1031,7 @@ SystemLoader.prototype.normalize = function(name, parentName, parentAddress) {
10331031

10341032
// not absolute or relative -> apply paths (what will be sites)
10351033
if (!name.match(absURLRegEx) && name[0] != '.')
1036-
name = new URL(applyPaths(this, name), baseURI).href;
1034+
name = new URL(applyPaths(this.paths, name), baseURI).href;
10371035
// apply parent-relative normalization, parentAddress is already normalized
10381036
else
10391037
name = new URL(name, parentName || baseURI).href;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "es6-module-loader",
33
"description": "An ES6 Module Loader shim",
4-
"version": "0.17.0",
4+
"version": "0.17.1",
55
"homepage": "https://github.com/ModuleLoader/es6-module-loader",
66
"author": {
77
"name": "Guy Bedford, Luke Hoban, Addy Osmani",

0 commit comments

Comments
 (0)