michael@0: function test1() { michael@0: function h(node) { michael@0: var x = 0.1; michael@0: for (var i=0; i<100; i++) { michael@0: x += node.parent; michael@0: } michael@0: return x; michael@0: } michael@0: function build(depth) { michael@0: if (depth > 10) michael@0: return {parent: 3.3}; michael@0: return {__proto__: build(depth + 1)}; michael@0: } michael@0: var tree = build(0); michael@0: assertEq(h(tree)|0, 330); michael@0: } michael@0: test1(); michael@0: michael@0: function test2() { michael@0: function Foo() {}; michael@0: Foo.prototype.x = 3.3; michael@0: michael@0: var o = new Foo(); michael@0: for (var i=0; i<100; i++) { michael@0: assertEq(o.x, 3.3); michael@0: } michael@0: } michael@0: test2();