PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

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

http://github.com/zpao/v8monkey
JavaScript | 21 lines | 18 code | 1 blank | 2 comment | 1 complexity | 61e06dd009acd5921cf924ea4e3ea9b3 MD5 | raw file
 1delete q;
 2delete g;
 3delete h;
 4delete a;
 5delete f;
 6
 7function 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}
21assertEq(testRebranding2(), "ok");