~ubuntu-branches/ubuntu/saucy/mozjs17/saucy

« back to all changes in this revision

Viewing changes to js/src/jit-test/tests/basic/testIn.js

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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");