Skip to content

Commit 28b3af4

Browse files
committed
use Object.values
1 parent b22020c commit 28b3af4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/components/blocks/blocks.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,6 @@ Blocks.prototype.addEdge = function(blockOut, fieldOut, blockIn, fieldIn, isData
708708
if (!this.areTypesCompatible(fieldIn, fieldOut)) {
709709
throw 'Types are not compatible';
710710
}
711-
712711
// Check whether the data type allows multiple input edges
713712
if (fieldIn.getEdgeCount() > 0 && !fieldIn.allowsMultipleEdges()) {
714713
throw 'Parameter accepts only one input';
@@ -837,10 +836,8 @@ Blocks.prototype.importProcessGraph = function(processGraph, registry) {
837836

838837
// Import edges
839838
var nodes = pg.getNodes();
840-
// iterating directly through nodes causes error in Edge. Using keys instead
841-
var keys = Object.keys(nodes);
842-
keys.forEach(function(key) {
843-
var node = nodes[key];
839+
// iterating using for in loop causes error in edge
840+
Object.values(nodes).forEach(node => {
844841

845842
var args = node.getArgumentNames();
846843
for(let i in args) {
@@ -869,7 +866,7 @@ Blocks.prototype.importProcessGraph = function(processGraph, registry) {
869866
break;
870867
}
871868
}
872-
}, this);
869+
});
873870
},
874871

875872
Blocks.prototype.importNodesFromProcessGraph = function(nodes, x = 0, y = 0) {

0 commit comments

Comments
 (0)