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

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 // test getthisprop
     3 var expected = "22,22,22,;33,33,33,;";
     4 var actual = '';
     6 function f() {
     7   for (var i = 0; i < 3; ++i) {
     8     actual += this.b + ',';
     9   }
    10   actual += ';';
    11 }
    13 function A() {
    14   this.a = 11;
    15   this.b = 22;
    16 };
    18 A.prototype.f = f;
    20 function B() {
    21   this.b = 33;
    22   this.c = 44;
    23 };
    25 B.prototype.f = f;
    27 new A().f();
    28 new B().f();
    30 assertEq(actual, expected);

mercurial