resolveSync fixup

This commit is contained in:
guybedford 2017-01-31 08:44:43 +02:00
parent d1bdd5d150
commit ca6dfee95d
2 changed files with 4 additions and 6 deletions

View File

@ -224,10 +224,7 @@ function packageResolveSync (config, key, parentKey, metadata, parentMetadata, s
}
}
var trailingSlash = key[key.length - 1] === '/';
var normalized = coreResolve.call(this, config, trailingSlash ? key : key + '/', parentKey, true, true);
if (!trailingSlash)
normalized = normalized.substr(0, normalized.length - 1);
var normalized = coreResolve.call(this, config, key, parentKey, true, true);
var pkgConfigMatch = getPackageConfigMatch(config, normalized);
metadata.packageKey = pkgConfigMatch && pkgConfigMatch.packageKey || getMapMatch(config.packages, normalized);

View File

@ -234,8 +234,6 @@ suite('SystemJS Standard Tests', function() {
}
});
var base = System.resolveSync('./');
return Promise.all([
System.resolve('a'),
System.resolve('f/b'),
@ -246,6 +244,9 @@ suite('SystemJS Standard Tests', function() {
System.resolve('b.js/c'),
System.resolve('g/x')
]).then(function (a) {
var base = System.resolveSync('');
console.log(base);
ok(base.length > 10);
ok(a[0] === base + 'b');
ok(a[1] === base + 'c/b');
ok(a[2] === base + 'b/b');