Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
ensure interpolation canonicalization
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 15, 2016
1 parent e534909 commit d3b97d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Builder.prototype.reset = function(baseLoader) {

var loaderConfig = loader.config;
loader.config = function(cfg) {
loaderConfig.call(loader, cfg);
loaderConfig.call(this, cfg);
loader.pluginLoader.config(cfg);
loader.configHash = generateConfigHash(loader);
};
Expand Down
4 changes: 2 additions & 2 deletions lib/trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,11 +567,11 @@ function toCanonicalConditionalEnv(conditionalEnv) {
return Promise.all(Object.keys(conditionalEnv).map(function(m) {
var negate = m[0] == '~';
var exportIndex = m.lastIndexOf('|');
var moduleName = m.substring(negate, exportIndex != -1 && exportIndex);
var moduleName = m.substring(negate, exportIndex != -1 ? exportIndex : m.length);

return loader.normalize(moduleName)
.then(function(normalized) {
var canonicalCondition = (negate ? '~' : '') + getCanonicalName(loader, normalized) + (exportIndex != -1 ? m.substr(exportIndex) : '');
var canonicalCondition = (negate ? '~' : '') + getCanonicalName(loader, normalized) + (exportIndex != -1 ? m.substr(exportIndex) : '|default');
canonicalConditionalEnv[canonicalCondition] = conditionalEnv[m];
});
}))
Expand Down

0 comments on commit d3b97d2

Please sign in to comment.