michael@0: // |jit-test| error:ReferenceError michael@0: michael@0: // Binary: cache/js-dbg-64-d3215d1e985a-linux michael@0: // Flags: -m -n -a michael@0: // michael@0: function ygTreeView(id) { michael@0: this.init(id) michael@0: } michael@0: ygTreeView.prototype.init = function (id) { michael@0: this.root = new ygRootNode(this) michael@0: }; michael@0: function ygNode() {} michael@0: ygNode.prototype.init = function (_32, _33, _34) { michael@0: this.children = [] michael@0: this.expanded = _34 michael@0: if (_33) _33.appendChild(this) michael@0: }; michael@0: ygNode.prototype.appendChild = function (_35) { michael@0: this.children[this.children.length] = _35 michael@0: }; michael@0: ygNode.prototype.hasChildren = function () { michael@0: return this.children.length > 0; michael@0: }; michael@0: ygNode.prototype.getHtml = function () { michael@0: var sb = []; michael@0: if (this.hasChildren(true) && this.expanded) sb[sb.length] = this.renderChildren() michael@0: }; michael@0: ygNode.prototype.renderChildren = function () { michael@0: this.completeRender() michael@0: }; michael@0: ygNode.prototype.completeRender = function () { michael@0: for (var i = 0;;) sb[sb.length] = this.children[i].getHtml() michael@0: }; michael@0: ygRootNode.prototype = new ygNode; michael@0: michael@0: function ygRootNode(_48) { michael@0: this.init(null, null, true) michael@0: } michael@0: ygTextNode.prototype = new ygNode; michael@0: function ygTextNode(_49, _50, _51) { michael@0: this.init(_49, _50, _51) michael@0: } michael@0: function buildUserTree() { michael@0: userTree = new ygTreeView("userTree") michael@0: addMenuNode(userTree, "N", "navheader") michael@0: } michael@0: function addMenuNode(tree, label, styleClass) { michael@0: new ygTextNode({}, tree.root, false) michael@0: } michael@0: buildUserTree(); michael@0: userTree.root.getHtml()