diff --git a/lib/conductor.js b/lib/conductor.js index d340937..83015b0 100644 --- a/lib/conductor.js +++ b/lib/conductor.js @@ -145,6 +145,9 @@ function Edge(node, type) { var ports = [], self = this; + for (var i in this.ports) { + ports[i] = this.ports[i].value(context); + } for (var c in self.node.edges.callback.ports) { (function(port, index) { @@ -153,17 +156,13 @@ function Edge(node, type) { }; })(self.node.edges.callback.ports[c], c); } - - - for (var i in this.ports) { - ports[i] = this.ports[i].value(context); - } return ports; }; this.satisfied = function(context) { context.prepare(this.node); var ports = context.nodes[node.index].edges[this.type].ports; + if (this.length() === 0) { return true; } @@ -178,6 +177,7 @@ function Edge(node, type) { } } } + for (var m=0; m