It seems that phantomjs has a bug in strict mode. Consider you have following code:
"use strict";
function f(x) {
x = 1;
return arguments[0]; // in phantomjs this returns 1, regardless of the given parameter
}
console.log(f({ attr: "foo" }));
Graph.setEdge() currently relies on strict mode working correctly. Suggested implementation would be something along these lines:
Graph.prototype.setEdge = function(v, w, value, name) {
var valueSpecified = arguments.length > 2;
if (_.isPlainObject(v)) {
name = v.name;
if (arguments.length === 2) {
value = w;
valueSpecified = true;
}
w = v.w;
v = v.v;
} else {
if (!_.isUndefined(name)) {
name = String(name);
}
}
v = String(v);
w = String(w);
// ... rest is working correctly