Skip to content

Instantly share code, notes, and snippets.

@romashamin
Created November 10, 2015 20:01
Show Gist options
  • Save romashamin/093179c1650fd6e0d073 to your computer and use it in GitHub Desktop.
Save romashamin/093179c1650fd6e0d073 to your computer and use it in GitHub Desktop.
/**
* @class
* @property {CGPoint} cgPoint
*/
function Node(cgPoint) {
this.point = cgPoint || { x: 0, y: 0 };
this.edges = [];
}
/**
* @param {string} nodeID
*/
Node.prototype.addEdge = function(node) {
node && this.edges.push(node);
return this;
};
var st = new Node();
st.addEdge(new Node()); // OK
st.addEdge(st); // This one crashes Sketch :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment