michael@0: // test getthisprop michael@0: michael@0: var expected = "22,22,22,;33,33,33,;"; michael@0: var actual = ''; michael@0: michael@0: function f() { michael@0: for (var i = 0; i < 3; ++i) { michael@0: actual += this.b + ','; michael@0: } michael@0: actual += ';'; michael@0: } michael@0: michael@0: function A() { michael@0: this.a = 11; michael@0: this.b = 22; michael@0: }; michael@0: michael@0: A.prototype.f = f; michael@0: michael@0: function B() { michael@0: this.b = 33; michael@0: this.c = 44; michael@0: }; michael@0: michael@0: B.prototype.f = f; michael@0: michael@0: new A().f(); michael@0: new B().f(); michael@0: michael@0: assertEq(actual, expected);