js/src/jit-test/tests/basic/testIn.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 function testIn() {
     2     var array = [3];
     3     var obj = { "-1": 5, "1.7": 3, "foo": 5, "1": 7 };
     4     var a = [];
     5     for (let j = 0; j < 5; ++j) {
     6         a.push("0" in array);
     7         a.push(-1 in obj);
     8         a.push(1.7 in obj);
     9         a.push("foo" in obj);
    10         a.push(1 in obj);
    11         a.push("1" in array);
    12         a.push(-2 in obj);
    13         a.push(2.7 in obj);
    14         a.push("bar" in obj);
    15         a.push(2 in obj);
    16     }
    17     return a.join(",");
    18 }
    19 assertEq(testIn(), "true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,false,false,false,false,false");

mercurial