summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testStringIncrement.js
blob: b0cc6775ecbb45d996313cbe9f4cde10156dd713 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var a, b;

function f(str) {
    var n;
    var k;
    for (var i = 0; i < 18; ++i) {
	n = str;
	k = n++;
	if (k) { }
    }
    return [k, n];
}

[a, b] = f("10");
assertEq(a, 10);
assertEq(b, 11);

[a, b] = f("5");
assertEq(a, 5);
assertEq(b, 6);