michael@0: this.name = "outer"; michael@0: var sb = evalcx(''); michael@0: sb.name = "inner"; michael@0: sb.parent = this; michael@0: this.f = function name(outer) { michael@0: if (outer) { michael@0: return function () { michael@0: return name(false); michael@0: }(); michael@0: } michael@0: return this.name; michael@0: } michael@0: assertEq(evalcx('this.f = parent.f;\n' + michael@0: 'var s = "";\n' + michael@0: 'for (i = 0; i < 10; ++i)\n' + michael@0: ' s += f(true);\n' + michael@0: 's', michael@0: sb), michael@0: "outerouterouterouterouterouterouterouterouterouter");