js/src/jit-test/tests/pic/thisprop.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/pic/thisprop.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,30 @@
     1.4 +// test getthisprop
     1.5 +
     1.6 +var expected = "22,22,22,;33,33,33,;";
     1.7 +var actual = '';
     1.8 +
     1.9 +function f() {
    1.10 +  for (var i = 0; i < 3; ++i) {
    1.11 +    actual += this.b + ',';
    1.12 +  }
    1.13 +  actual += ';';
    1.14 +}
    1.15 +
    1.16 +function A() {
    1.17 +  this.a = 11;
    1.18 +  this.b = 22;
    1.19 +};
    1.20 +
    1.21 +A.prototype.f = f;
    1.22 +
    1.23 +function B() {
    1.24 +  this.b = 33;
    1.25 +  this.c = 44;
    1.26 +};
    1.27 +
    1.28 +B.prototype.f = f;
    1.29 +
    1.30 +new A().f();
    1.31 +new B().f();
    1.32 +
    1.33 +assertEq(actual, expected);

mercurial