(end)
| 13086 | } |
| 13087 | |
| 13088 | function node_path(end) { |
| 13089 | var start = this, |
| 13090 | ancestor = leastCommonAncestor(start, end), |
| 13091 | nodes = [start]; |
| 13092 | while (start !== ancestor) { |
| 13093 | start = start.parent; |
| 13094 | nodes.push(start); |
| 13095 | } |
| 13096 | var k = nodes.length; |
| 13097 | while (end !== ancestor) { |
| 13098 | nodes.splice(k, 0, end); |
| 13099 | end = end.parent; |
| 13100 | } |
| 13101 | return nodes; |
| 13102 | } |
| 13103 | |
| 13104 | function leastCommonAncestor(a, b) { |
| 13105 | if (a === b) return a; |
nothing calls this directly
no test coverage detected