js/src/jit-test/tests/ion/getelem-proto.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 var a = [1, , 2];
     2 Array.prototype[1] = 3;
     4 function f(arr) {
     5     return arr[0] + arr[1] + arr[2];
     6 }
     7 for (var i=0; i<70; i++) {
     8     assertEq(f(a), 6);
     9 }
    11 Object.defineProperty(Array.prototype, "1", {
    12     get: function() {
    13         return 1234;
    14     }
    15 });
    17 assertEq(f(a), 1237);
    18 assertEq(f(a), 1237);

mercurial