2014-07-13 01:04:16 +02:00
|
|
|
//// [decrementOperatorWithUnsupportedStringType.ts]
|
|
|
|
// -- operator on string type
|
|
|
|
var STRING: string;
|
|
|
|
var STRING1: string[] = ["", ""];
|
|
|
|
|
|
|
|
function foo(): string { return ""; }
|
|
|
|
|
|
|
|
class A {
|
|
|
|
public a: string;
|
|
|
|
static foo() { return ""; }
|
|
|
|
}
|
|
|
|
module M {
|
|
|
|
export var n: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
var objA = new A();
|
|
|
|
|
|
|
|
// string type var
|
|
|
|
var ResultIsNumber1 = --STRING;
|
|
|
|
var ResultIsNumber2 = --STRING1;
|
|
|
|
|
|
|
|
var ResultIsNumber3 = STRING--;
|
|
|
|
var ResultIsNumber4 = STRING1--;
|
|
|
|
|
|
|
|
// string type literal
|
|
|
|
var ResultIsNumber5 = --"";
|
|
|
|
var ResultIsNumber6 = --{ x: "", y: "" };
|
|
|
|
var ResultIsNumber7 = --{ x: "", y: (s: string) => { return s; } };
|
|
|
|
|
|
|
|
var ResultIsNumber8 = ""--;
|
|
|
|
var ResultIsNumber9 = { x: "", y: "" }--;
|
|
|
|
var ResultIsNumber10 = { x: "", y: (s: string) => { return s; } }--;
|
|
|
|
|
|
|
|
// string type expressions
|
|
|
|
var ResultIsNumber11 = --objA.a;
|
|
|
|
var ResultIsNumber12 = --M.n;
|
|
|
|
var ResultIsNumber13 = --STRING1[0];
|
|
|
|
var ResultIsNumber14 = --foo();
|
|
|
|
var ResultIsNumber15 = --A.foo();
|
|
|
|
var ResultIsNumber16 = --(STRING + STRING);
|
|
|
|
|
|
|
|
var ResultIsNumber17 = objA.a--;
|
|
|
|
var ResultIsNumber18 = M.n--;
|
|
|
|
var ResultIsNumber19 = STRING1[0]--;
|
|
|
|
var ResultIsNumber20 = foo()--;
|
|
|
|
var ResultIsNumber21 = A.foo()--;
|
|
|
|
var ResultIsNumber22 = (STRING + STRING)--;
|
|
|
|
|
|
|
|
// miss assignment operators
|
|
|
|
--"";
|
|
|
|
--STRING;
|
|
|
|
--STRING1;
|
|
|
|
--STRING1[0];
|
|
|
|
--foo();
|
|
|
|
--objA.a;
|
|
|
|
--M.n;
|
|
|
|
--objA.a, M.n;
|
|
|
|
|
|
|
|
""--;
|
|
|
|
STRING--;
|
|
|
|
STRING1--;
|
|
|
|
STRING1[0]--;
|
|
|
|
foo()--;
|
|
|
|
objA.a--;
|
|
|
|
M.n--;
|
|
|
|
objA.a--, M.n--;
|
|
|
|
|
|
|
|
//// [decrementOperatorWithUnsupportedStringType.js]
|
2014-08-12 00:54:12 +02:00
|
|
|
// -- operator on string type
|
2014-07-13 01:04:16 +02:00
|
|
|
var STRING;
|
|
|
|
var STRING1 = ["", ""];
|
2015-02-07 05:03:24 +01:00
|
|
|
function foo() { return ""; }
|
2014-07-13 01:04:16 +02:00
|
|
|
var A = (function () {
|
|
|
|
function A() {
|
|
|
|
}
|
2015-02-07 05:03:24 +01:00
|
|
|
A.foo = function () { return ""; };
|
2014-07-13 01:04:16 +02:00
|
|
|
return A;
|
|
|
|
})();
|
|
|
|
var M;
|
|
|
|
(function (M) {
|
|
|
|
M.n;
|
|
|
|
})(M || (M = {}));
|
|
|
|
var objA = new A();
|
2014-08-12 00:54:12 +02:00
|
|
|
// string type var
|
2014-07-13 01:04:16 +02:00
|
|
|
var ResultIsNumber1 = --STRING;
|
|
|
|
var ResultIsNumber2 = --STRING1;
|
|
|
|
var ResultIsNumber3 = STRING--;
|
|
|
|
var ResultIsNumber4 = STRING1--;
|
2014-08-12 00:54:12 +02:00
|
|
|
// string type literal
|
2014-07-13 01:04:16 +02:00
|
|
|
var ResultIsNumber5 = --"";
|
|
|
|
var ResultIsNumber6 = --{ x: "", y: "" };
|
2015-02-07 05:03:24 +01:00
|
|
|
var ResultIsNumber7 = --{ x: "", y: function (s) { return s; } };
|
2014-07-13 01:04:16 +02:00
|
|
|
var ResultIsNumber8 = ""--;
|
|
|
|
var ResultIsNumber9 = { x: "", y: "" }--;
|
2015-02-07 05:03:24 +01:00
|
|
|
var ResultIsNumber10 = { x: "", y: function (s) { return s; } }--;
|
2014-08-12 00:54:12 +02:00
|
|
|
// string type expressions
|
2014-07-13 01:04:16 +02:00
|
|
|
var ResultIsNumber11 = --objA.a;
|
|
|
|
var ResultIsNumber12 = --M.n;
|
|
|
|
var ResultIsNumber13 = --STRING1[0];
|
|
|
|
var ResultIsNumber14 = --foo();
|
|
|
|
var ResultIsNumber15 = --A.foo();
|
|
|
|
var ResultIsNumber16 = --(STRING + STRING);
|
|
|
|
var ResultIsNumber17 = objA.a--;
|
|
|
|
var ResultIsNumber18 = M.n--;
|
|
|
|
var ResultIsNumber19 = STRING1[0]--;
|
|
|
|
var ResultIsNumber20 = foo()--;
|
|
|
|
var ResultIsNumber21 = A.foo()--;
|
|
|
|
var ResultIsNumber22 = (STRING + STRING)--;
|
2014-08-16 00:49:09 +02:00
|
|
|
// miss assignment operators
|
2014-07-13 01:04:16 +02:00
|
|
|
--"";
|
|
|
|
--STRING;
|
|
|
|
--STRING1;
|
|
|
|
--STRING1[0];
|
|
|
|
--foo();
|
|
|
|
--objA.a;
|
|
|
|
--M.n;
|
|
|
|
--objA.a, M.n;
|
|
|
|
""--;
|
|
|
|
STRING--;
|
|
|
|
STRING1--;
|
|
|
|
STRING1[0]--;
|
|
|
|
foo()--;
|
|
|
|
objA.a--;
|
|
|
|
M.n--;
|
|
|
|
objA.a--, M.n--;
|