PageRenderTime 19ms CodeModel.GetById 11ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/zpao/v8monkey
JavaScript | 20 lines | 20 code | 0 blank | 0 comment | 1 complexity | 5408f0209015cc70cf0081fdc605c789 MD5 | raw file
 1function testStringify() {
 2    var t = true, f = false, u = undefined, n = 5, d = 5.5, s = "x";
 3    var a = [];
 4    for (var i = 0; i < 10; ++i) {
 5        a[0] = "" + t;
 6        a[1] = t + "";
 7        a[2] = "" + f;
 8        a[3] = f + "";
 9        a[4] = "" + u;
10        a[5] = u + "";
11        a[6] = "" + n;
12        a[7] = n + "";
13        a[8] = "" + d;
14        a[9] = d + "";
15        a[10] = "" + s;
16        a[11] = s + "";
17    }
18    return a.join(",");
19}
20assertEq(testStringify(), "true,true,false,false,undefined,undefined,5,5,5.5,5.5,x,x");