~ubuntu-branches/ubuntu/trusty/mozjs17/trusty

« back to all changes in this revision

Viewing changes to js/src/jit-test/tests/basic/testRebranding2.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
delete q;
 
2
delete g;
 
3
delete h;
 
4
delete a;
 
5
delete f;
 
6
 
 
7
function testRebranding2() {
 
8
    // Same as testRebranding, but the object to be rebranded isn't the global.
 
9
    var x = "FAIL";
 
10
    function g(){}
 
11
    function h(){ x = "ok"; }
 
12
    var obj = {m: g};
 
13
    var arr = [g, g, g, g, h];
 
14
    //assertEq(arr.length > 9, true);
 
15
    for (var i = 0; i < 5; i++) {
 
16
        obj.m = arr[i];
 
17
        obj.m();
 
18
    }
 
19
    return x;
 
20
}
 
21
assertEq(testRebranding2(), "ok");