web: add var declarations

Since scripts are run in module mode, they follow the "strict mode"
semantics. Variables must be declared prior to being assigned (e.g.
cannot have `x = 1` without declaring x (using var, let, or const)

Signed-off-by: Aidan Oldershaw <aoldershaw@pivotal.io>
This commit is contained in:
Aidan Oldershaw 2020-02-10 12:59:12 -05:00
parent c02133dcee
commit b518fb1742
2 changed files with 2 additions and 2 deletions

View File

@ -355,7 +355,7 @@ Graph.prototype.addSpacingNodes = function() {
this.setNode(spacingNode.id, spacingNode);
}
currentCustomData = (i == 0 ? initialCustomData : null)
var currentCustomData = (i == 0 ? initialCustomData : null)
this.addEdge(upstreamNode.id, spacingNode.id, edge.key, currentCustomData);
upstreamNode = spacingNode;

View File

@ -168,7 +168,7 @@ function redrawFunction(svg, jobs, resources, newUrl) {
var graphNodes = graph.nodes()
for (var i in graphNodes) {
if (graphNodes[i].status == "failed") {
xCenter = graphNodes[i].position().x + (graphNodes[i].width() / 2)
var xCenter = graphNodes[i].position().x + (graphNodes[i].width() / 2)
var found = false
for (var i in failureCenters) {
if (Math.abs(xCenter - failureCenters[i]) < epsilon) {