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

Commit e4ac34d

Browse files
committed
applyPaths adjustment
1 parent ea56363 commit e4ac34d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/system-resolve.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SystemLoader.prototype.normalize = function(name, parentName, parentAddress) {
88

99
// not absolute or relative -> apply paths (what will be sites)
1010
if (!name.match(absURLRegEx) && name[0] != '.')
11-
name = new URL(applyPaths(this, name), baseURI).href;
11+
name = new URL(applyPaths(this.paths, name), baseURI).href;
1212
// apply parent-relative normalization, parentAddress is already normalized
1313
else
1414
name = new URL(name, parentName || baseURI).href;

src/system.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ function SystemLoader() {
1818
}
1919

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

2525
// check to see if we have a paths entry
26-
for (var p in loader.paths) {
26+
for (var p in paths) {
2727
var pathParts = p.split('*');
2828
if (pathParts.length > 2)
2929
throw new TypeError('Only one wildcard in a path is permitted');
@@ -48,7 +48,7 @@ function applyPaths(loader, name) {
4848
}
4949
}
5050

51-
var outPath = loader.paths[pathMatch] || name;
51+
var outPath = paths[pathMatch] || name;
5252
if (wildcard)
5353
outPath = outPath.replace('*', wildcard);
5454

0 commit comments

Comments
 (0)