diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index 054e6bf22..a453a8a1a 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -10,16 +10,10 @@ class Compiler { compile_contracts(contractFiles, cb) { let available_compilers = {}; - if (this.plugins) { - let compilerPlugins = this.plugins.getPluginsFor('compilers'); - if (compilerPlugins.length > 0) { - compilerPlugins.forEach(function (plugin) { - plugin.compilers.forEach(function (compilerObject) { - available_compilers[compilerObject.extension] = compilerObject.cb; - }); - }); - } - } + let pluginCompilers = this.plugins.getPluginsProperty('compilers', 'compilers'); + pluginCompilers.forEach(function (compilerObject) { + available_compilers[compilerObject.extension] = compilerObject.cb; + }); let compiledObject = {}; diff --git a/lib/core/plugins.js b/lib/core/plugins.js index 3ac88052c..83a5bd347 100644 --- a/lib/core/plugins.js +++ b/lib/core/plugins.js @@ -56,9 +56,13 @@ Plugins.prototype.getPluginsProperty = function(pluginType, property) { return plugin.has(pluginType); }); - return matchingPlugins.map((plugin) => { + let matchingProperties = matchingPlugins.map((plugin) => { return plugin[property]; }); + + //return flattened list + if (matchingProperties.length === 0) return []; + return matchingProperties.reduce((a,b) => { return a.concat(b); }) }; module.exports = Plugins;