From 04ffaeb2b802cd93328574196d4a1d09a5c4c03a Mon Sep 17 00:00:00 2001 From: Anna Thomas Date: Mon, 24 Nov 2014 15:44:11 +0000 Subject: [PATCH] Refactor nodeModules.nodes to moduleNodes --- red/nodes/registry.js | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/red/nodes/registry.js b/red/nodes/registry.js index b3ca1e97d..bc606f5b1 100644 --- a/red/nodes/registry.js +++ b/red/nodes/registry.js @@ -52,7 +52,7 @@ var registry = (function() { var nodeList = []; var nodeConstructors = {}; var nodeTypeToId = {}; - var nodeModules = {}; + var moduleNodes = {}; function saveNodeList() { var nodeList = {}; @@ -89,7 +89,7 @@ var registry = (function() { } else { nodeConfigs = {}; } - nodeModules = {}; + moduleNodes = {}; nodeTypeToId = {}; nodeConstructors = {}; nodeList = []; @@ -102,11 +102,10 @@ var registry = (function() { }); } - nodeModules[set.module] = nodeModules[set.module]||{nodes:[]}; - nodeModules[set.module].nodes.push(set.name); + moduleNodes[set.module] = moduleNodes[set.module]||[]; + moduleNodes[set.module].push(set.name); if (version) { - nodeModules[set.module].version = version.replace(/(\r\n|\n|\r)/gm,""); } nodeConfigs[id] = set; @@ -136,15 +135,15 @@ var registry = (function() { if (!settings.available()) { throw new Error("Settings unavailable"); } - var nodes = nodeModules[module]; + var nodes = moduleNodes[module]; if (!nodes) { throw new Error("Unrecognised module: "+module); } var infoList = []; - for (var i=0;i