Enable strict mode and fix two scope errors

This commit is contained in:
anatoly techtonik 2013-03-12 12:30:52 +03:00
parent 77dfdb9e1d
commit 947fc903fa

View File

@ -1,5 +1,5 @@
/**
* Springy v1.1.0
* Springy v1.1.1
*
* Copyright (c) 2010 Dennis Hotson
*
@ -25,6 +25,9 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
// Enable strict mode for EC5 compatible browsers
"use strict";
var Graph = function() {
this.nodeSet = {};
this.nodes = [];
@ -74,7 +77,7 @@ Graph.prototype.addNodes = function() {
// is a string that becomes both node identifier and label
for (var i = 0; i < arguments.length; i++) {
var name = arguments[i];
var node = new Node(name, data = {label:name});
var node = new Node(name, {label:name});
this.addNode(node);
}
};
@ -493,7 +496,7 @@ Layout.ForceDirected.prototype.getBoundingBox = function() {
// Vector
Vector = function(x, y) {
var Vector = function(x, y) {
this.x = x;
this.y = y;
};