js/src/jit-test/tests/basic/testIn.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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