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

Make exact matches win for path lookup #190

Merged
merged 1 commit into from
Jul 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@

// exact path match
if (pathParts.length == 1) {
if (name == p && p.length > pathMatch.length)
if (name == p && p.length > pathMatch.length) {
pathMatch = p;
break;
}
}

// wildcard path match
Expand Down
2 changes: 2 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,9 @@ function runTests() {
});

test('Custom path most specific', function(assert) {
delete System.paths['bar/*'];
System.paths['bar/bar'] = 'loader/specific-path.js';
System.paths['bar/*'] = 'loader/custom-folder/*.js';
System['import']('bar/bar').then(function(m) {
assert(m.path, true);
});
Expand Down