[API] Fix logging of paths

When extensions have an explicitly-declared implementation,
do not log that they are being loaded.
This commit is contained in:
Victor Woeltjen 2016-01-07 16:04:23 -08:00
parent 7728d308f2
commit 2b4d6c111c
2 changed files with 12 additions and 11 deletions

View File

@ -133,7 +133,7 @@ define(
* @returns {string} path to implementation, or undefined
*/
Extension.prototype.getImplementationPath = function () {
return this.definition.implementation ?
return (this.hasImplementation() && !this.hasImplementationValue()) ?
this.bundle.getSourcePath(this.definition.implementation) :
undefined;
};

View File

@ -61,10 +61,9 @@ define(
$log = this.$log;
function loadImplementation(extension) {
var implPath = extension.getImplementationPath(),
implPromise = extension.hasImplementationValue() ?
var implPromise = extension.hasImplementationValue() ?
Promise.resolve(extension.getImplementationValue()) :
loader.load(implPath),
loader.load(extension.getImplementationPath()),
definition = extension.getDefinition();
// Wrap a constructor function (to avoid modifying the original)
@ -119,13 +118,15 @@ define(
return extension.getDefinition();
}
// Log that loading has begun
$log.info([
"Loading implementation ",
implPath,
" for extension ",
extension.getLogName()
].join(""));
if (!extension.hasImplementationValue()) {
// Log that loading has begun
$log.info([
"Loading implementation ",
extension.getImplementationPath(),
" for extension ",
extension.getLogName()
].join(""));
}
return implPromise.then(attachDefinition, handleError);
}