From 78effaa09ff34cac539a0f637029b4097afa9934 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 4 Nov 2014 13:51:12 -0800 Subject: [PATCH] [Framework] Fix code style in BundleLoader Fix code style and remove unuseful code from BundleLoader, WTD-518. --- platform/framework/src/BundleLoader.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/platform/framework/src/BundleLoader.js b/platform/framework/src/BundleLoader.js index deb99846a9..cac1e29bbd 100644 --- a/platform/framework/src/BundleLoader.js +++ b/platform/framework/src/BundleLoader.js @@ -1,4 +1,4 @@ -/*global define*/ +/*global define,Promise*/ /** * Module defining BundleLoader.js. Created by vwoeltje on 10/31/14. @@ -33,14 +33,7 @@ define( // loadBundleDefinition, so at this point they are safe // to discard. function filterBundles(array) { - return array.map(function (x) { return x !== undefined; }); - } - - // Convert JSON bundle definitions to Bundle objects. - function objectifyBundles(bundleDefinitions) { - return bundleDefinitions.map(function (definition) { - return new Bundle() - }); + return array.filter(function (x) { return x !== undefined; }); } // Load a definition for a bundle @@ -67,11 +60,10 @@ define( } function loadBundlesFromArray(bundleArray) { - var bundlePromises = bundleArray.map(loadBundleDefinition); + var bundlePromises = bundleArray.map(loadBundle); return Promise.all(bundlePromises) - .then(filterBundles) - .then(objectifyBundles); + .then(filterBundles); } function loadBundlesFromFile(listFile) {