blob: 34ab6584d91cbfdd50dcab34cf4d22196e8dc38b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
function f_localinc(x) {
var a = x;
var b = a++;
var c = b+b+b+b+b+b+b+b+b+b;
return a + c;
}
assertEq(f_localinc(1), 12)
function f_localdec(x) {
var a = x;
var b = a--;
var c = b+b+b+b+b+b+b+b+b+b;
return a + c;
}
assertEq(f_localdec(1), 10)
function f_inclocal(x) {
var a = x;
var b = ++a;
var c = b+b+b+b+b+b+b+b+b+b;
return a + c;
}
assertEq(f_inclocal(1), 22)
function f_declocal(x) {
var a = x;
var b = --a;
var c = b+b+b+b+b+b+b+b+b+b;
return a + c;
}
assertEq(f_declocal(1), 0)
|