2014-07-13 01:04:16 +02:00
|
|
|
//// [decrementOperatorWithAnyOtherType.ts]
|
|
|
|
// -- operator on any type
|
|
|
|
|
|
|
|
var ANY: any;
|
|
|
|
var ANY1;
|
|
|
|
var ANY2: any[] = ["", ""];
|
|
|
|
var obj = {x:1,y:null};
|
|
|
|
class A {
|
|
|
|
public a: any;
|
|
|
|
}
|
|
|
|
module M {
|
|
|
|
export var n: any;
|
|
|
|
}
|
|
|
|
var objA = new A();
|
|
|
|
|
|
|
|
// any type var
|
|
|
|
var ResultIsNumber1 = --ANY;
|
|
|
|
var ResultIsNumber2 = --ANY1;
|
|
|
|
|
|
|
|
var ResultIsNumber3 = ANY1--;
|
|
|
|
var ResultIsNumber4 = ANY1--;
|
|
|
|
|
|
|
|
// expressions
|
|
|
|
var ResultIsNumber5 = --ANY2[0];
|
|
|
|
var ResultIsNumber6 = --obj.x;
|
|
|
|
var ResultIsNumber7 = --obj.y;
|
|
|
|
var ResultIsNumber8 = --objA.a;
|
|
|
|
var ResultIsNumber = --M.n;
|
|
|
|
|
|
|
|
var ResultIsNumber9 = ANY2[0]--;
|
|
|
|
var ResultIsNumber10 = obj.x--;
|
|
|
|
var ResultIsNumber11 = obj.y--;
|
|
|
|
var ResultIsNumber12 = objA.a--;
|
|
|
|
var ResultIsNumber13 = M.n--;
|
|
|
|
|
|
|
|
// miss assignment opertors
|
|
|
|
--ANY;
|
|
|
|
--ANY1;
|
|
|
|
--ANY2[0];
|
|
|
|
--ANY, --ANY1;
|
|
|
|
--objA.a;
|
|
|
|
--M.n;
|
|
|
|
|
|
|
|
ANY--;
|
|
|
|
ANY1--;
|
|
|
|
ANY2[0]--;
|
|
|
|
ANY--, ANY1--;
|
|
|
|
objA.a--;
|
|
|
|
M.n--;
|
|
|
|
|
|
|
|
//// [decrementOperatorWithAnyOtherType.js]
|
2014-08-12 00:54:12 +02:00
|
|
|
// -- operator on any type
|
2014-07-13 01:04:16 +02:00
|
|
|
var ANY;
|
|
|
|
var ANY1;
|
|
|
|
var ANY2 = ["", ""];
|
|
|
|
var obj = { x: 1, y: null };
|
|
|
|
var A = (function () {
|
|
|
|
function A() {
|
|
|
|
}
|
|
|
|
return A;
|
|
|
|
})();
|
|
|
|
var M;
|
|
|
|
(function (M) {
|
|
|
|
M.n;
|
|
|
|
})(M || (M = {}));
|
|
|
|
var objA = new A();
|
2014-08-12 00:54:12 +02:00
|
|
|
// any type var
|
2014-07-13 01:04:16 +02:00
|
|
|
var ResultIsNumber1 = --ANY;
|
|
|
|
var ResultIsNumber2 = --ANY1;
|
|
|
|
var ResultIsNumber3 = ANY1--;
|
|
|
|
var ResultIsNumber4 = ANY1--;
|
2014-08-12 00:54:12 +02:00
|
|
|
// expressions
|
2014-07-13 01:04:16 +02:00
|
|
|
var ResultIsNumber5 = --ANY2[0];
|
|
|
|
var ResultIsNumber6 = --obj.x;
|
|
|
|
var ResultIsNumber7 = --obj.y;
|
|
|
|
var ResultIsNumber8 = --objA.a;
|
|
|
|
var ResultIsNumber = --M.n;
|
|
|
|
var ResultIsNumber9 = ANY2[0]--;
|
|
|
|
var ResultIsNumber10 = obj.x--;
|
|
|
|
var ResultIsNumber11 = obj.y--;
|
|
|
|
var ResultIsNumber12 = objA.a--;
|
|
|
|
var ResultIsNumber13 = M.n--;
|
2014-08-16 00:49:09 +02:00
|
|
|
// miss assignment opertors
|
2014-07-13 01:04:16 +02:00
|
|
|
--ANY;
|
|
|
|
--ANY1;
|
|
|
|
--ANY2[0];
|
|
|
|
--ANY, --ANY1;
|
|
|
|
--objA.a;
|
|
|
|
--M.n;
|
|
|
|
ANY--;
|
|
|
|
ANY1--;
|
|
|
|
ANY2[0]--;
|
|
|
|
ANY--, ANY1--;
|
|
|
|
objA.a--;
|
|
|
|
M.n--;
|