PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

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

http://github.com/zpao/v8monkey
JavaScript | 11 lines | 10 code | 1 blank | 0 comment | 2 complexity | 3f48934f7cdc17910387c22dd72faa9e MD5 | raw file
 1var obj = {s: ""};
 2var name = "s";
 3var a = [];
 4for (var i = 0; i <= 13; i++) {
 5    a[i] = 'x';
 6    if (i > 8)
 7        a[i] = --obj[name];  // first recording changes obj.s from string to number
 8}
 9assertEq(a.join(','), Array(10).join('x,') + '-1,-2,-3,-4,-5');
10assertEq(obj.s, -5);
11