2014-07-13 01:04:16 +02:00
|
|
|
//// [decrementAndIncrementOperators.ts]
|
|
|
|
var x = 0;
|
|
|
|
|
|
|
|
// errors
|
|
|
|
1 ++;
|
|
|
|
|
|
|
|
(1)++;
|
|
|
|
(1)--;
|
|
|
|
|
|
|
|
++(1);
|
|
|
|
--(1);
|
|
|
|
|
|
|
|
(1 + 2)++;
|
|
|
|
(1 + 2)--;
|
|
|
|
|
|
|
|
++(1 + 2);
|
|
|
|
--(1 + 2);
|
|
|
|
|
|
|
|
(x + x)++;
|
|
|
|
(x + x)--;
|
|
|
|
|
|
|
|
++(x + x);
|
|
|
|
--(x + x);
|
|
|
|
|
|
|
|
//OK
|
|
|
|
x++;
|
|
|
|
x--;
|
|
|
|
|
|
|
|
++x;
|
|
|
|
--x;
|
|
|
|
|
|
|
|
(x)++;
|
|
|
|
--(x);
|
|
|
|
|
|
|
|
((x))++;
|
|
|
|
((x))--;
|
|
|
|
|
|
|
|
x[x++]++;
|
|
|
|
|
|
|
|
|
|
|
|
//// [decrementAndIncrementOperators.js]
|
|
|
|
var x = 0;
|
2014-08-16 00:49:09 +02:00
|
|
|
// errors
|
2014-07-13 01:04:16 +02:00
|
|
|
1++;
|
|
|
|
(1)++;
|
|
|
|
(1)--;
|
|
|
|
++(1);
|
|
|
|
--(1);
|
|
|
|
(1 + 2)++;
|
|
|
|
(1 + 2)--;
|
|
|
|
++(1 + 2);
|
|
|
|
--(1 + 2);
|
|
|
|
(x + x)++;
|
|
|
|
(x + x)--;
|
|
|
|
++(x + x);
|
|
|
|
--(x + x);
|
2014-08-16 00:49:09 +02:00
|
|
|
//OK
|
2014-07-13 01:04:16 +02:00
|
|
|
x++;
|
|
|
|
x--;
|
|
|
|
++x;
|
|
|
|
--x;
|
|
|
|
(x)++;
|
|
|
|
--(x);
|
|
|
|
((x))++;
|
|
|
|
((x))--;
|
|
|
|
x[x++]++;
|