From 4ed1836ae5ba435061f39a51d2b8826593a682f8 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 7 Jan 2016 11:21:50 -0800 Subject: [PATCH] [API] Allow implementations to be passed directly Allow implementations to be passed in as values, instead of strings, facilitating the loading of said implementations via RequireJS. --- platform/framework/src/resolve/ExtensionResolver.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/framework/src/resolve/ExtensionResolver.js b/platform/framework/src/resolve/ExtensionResolver.js index e4c2710c0f..98e8443a03 100644 --- a/platform/framework/src/resolve/ExtensionResolver.js +++ b/platform/framework/src/resolve/ExtensionResolver.js @@ -61,8 +61,10 @@ define( $log = this.$log; function loadImplementation(extension) { - var implPath = extension.getImplementationPath(), - implPromise = loader.load(implPath), + var implValue = extension.getImplementationPath(), + implPromise = (typeof implValue === 'string') ? + loader.load(implValue) : + Promise.resolve(implValue), definition = extension.getDefinition(); // Wrap a constructor function (to avoid modifying the original) @@ -120,7 +122,7 @@ define( // Log that loading has begun $log.info([ "Loading implementation ", - implPath, + implValue, " for extension ", extension.getLogName() ].join(""));