Weave Milestone 1.7 released

A note about changes to the JavaScript API
Added by Andy Dufilie over 3 years ago

An important change was made to the Weave Path API in today's milestone version 1.7. The push() and pop() functions in the Weave Path API no longer modify the WeavePath object in place. This will make your Weave code more reliable. Because most Weave API code should use method chaining, it is unlikely that this change will have adverse effects on the code you have written. If you would like us to review your code for potential problems, feel free to contact us on the mailing list.

Behavior prior to Milestone 1.7

var path1 = weave.path("foo");
var path2 = path1.push("bar");

console.log( path1.getPath() ); // prints ["foo", "bar"]
console.log( path2.getPath() ); // prints ["foo", "bar"]
console.log( path1 == path2 ); // prints true because they are the same WeavePath object

Behavior after Milestone 1.7:

var path1 = weave.path("foo");
var path2 = path1.push("bar");

console.log( path1.getPath() ); // prints ["foo"]
console.log( path2.getPath() ); // prints ["foo", "bar"]
console.log( path1 == path2 ); // prints false because they are different WeavePath objects

console.log( path2.pop() == path1 ); // prints true because path2 was created with path1.push("bar")

Comments