Created
November 10, 2015 20:01
-
-
Save romashamin/093179c1650fd6e0d073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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