|
1 // |jit-test| error:ReferenceError |
|
2 |
|
3 // Binary: cache/js-dbg-64-d3215d1e985a-linux |
|
4 // Flags: -m -n -a |
|
5 // |
|
6 function ygTreeView(id) { |
|
7 this.init(id) |
|
8 } |
|
9 ygTreeView.prototype.init = function (id) { |
|
10 this.root = new ygRootNode(this) |
|
11 }; |
|
12 function ygNode() {} |
|
13 ygNode.prototype.init = function (_32, _33, _34) { |
|
14 this.children = [] |
|
15 this.expanded = _34 |
|
16 if (_33) _33.appendChild(this) |
|
17 }; |
|
18 ygNode.prototype.appendChild = function (_35) { |
|
19 this.children[this.children.length] = _35 |
|
20 }; |
|
21 ygNode.prototype.hasChildren = function () { |
|
22 return this.children.length > 0; |
|
23 }; |
|
24 ygNode.prototype.getHtml = function () { |
|
25 var sb = []; |
|
26 if (this.hasChildren(true) && this.expanded) sb[sb.length] = this.renderChildren() |
|
27 }; |
|
28 ygNode.prototype.renderChildren = function () { |
|
29 this.completeRender() |
|
30 }; |
|
31 ygNode.prototype.completeRender = function () { |
|
32 for (var i = 0;;) sb[sb.length] = this.children[i].getHtml() |
|
33 }; |
|
34 ygRootNode.prototype = new ygNode; |
|
35 |
|
36 function ygRootNode(_48) { |
|
37 this.init(null, null, true) |
|
38 } |
|
39 ygTextNode.prototype = new ygNode; |
|
40 function ygTextNode(_49, _50, _51) { |
|
41 this.init(_49, _50, _51) |
|
42 } |
|
43 function buildUserTree() { |
|
44 userTree = new ygTreeView("userTree") |
|
45 addMenuNode(userTree, "N", "navheader") |
|
46 } |
|
47 function addMenuNode(tree, label, styleClass) { |
|
48 new ygTextNode({}, tree.root, false) |
|
49 } |
|
50 buildUserTree(); |
|
51 userTree.root.getHtml() |