2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithEnumType.ts ===
|
|
|
|
// delete operator on enum type
|
|
|
|
|
|
|
|
enum ENUM { };
|
|
|
|
>ENUM : ENUM
|
|
|
|
|
2014-10-07 07:27:22 +02:00
|
|
|
enum ENUM1 { A, B, "" };
|
2014-08-15 23:33:16 +02:00
|
|
|
>ENUM1 : ENUM1
|
2014-10-07 07:27:22 +02:00
|
|
|
>A : ENUM1
|
|
|
|
>B : ENUM1
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
// enum type var
|
|
|
|
var ResultIsBoolean1 = delete ENUM;
|
|
|
|
>ResultIsBoolean1 : boolean
|
|
|
|
>delete ENUM : boolean
|
|
|
|
>ENUM : typeof ENUM
|
|
|
|
|
|
|
|
var ResultIsBoolean2 = delete ENUM1;
|
|
|
|
>ResultIsBoolean2 : boolean
|
|
|
|
>delete ENUM1 : boolean
|
|
|
|
>ENUM1 : typeof ENUM1
|
|
|
|
|
|
|
|
// enum type expressions
|
|
|
|
var ResultIsBoolean3 = delete ENUM1[0];
|
|
|
|
>ResultIsBoolean3 : boolean
|
|
|
|
>delete ENUM1[0] : boolean
|
|
|
|
>ENUM1[0] : string
|
|
|
|
>ENUM1 : typeof ENUM1
|
|
|
|
|
|
|
|
var ResultIsBoolean4 = delete (ENUM[0] + ENUM1[1]);
|
|
|
|
>ResultIsBoolean4 : boolean
|
|
|
|
>delete (ENUM[0] + ENUM1[1]) : boolean
|
|
|
|
>(ENUM[0] + ENUM1[1]) : string
|
|
|
|
>ENUM[0] + ENUM1[1] : string
|
|
|
|
>ENUM[0] : string
|
|
|
|
>ENUM : typeof ENUM
|
2014-10-07 07:27:22 +02:00
|
|
|
>ENUM1[1] : string
|
2014-08-15 23:33:16 +02:00
|
|
|
>ENUM1 : typeof ENUM1
|
|
|
|
|
|
|
|
// multiple delete operators
|
|
|
|
var ResultIsBoolean5 = delete delete ENUM;
|
|
|
|
>ResultIsBoolean5 : boolean
|
|
|
|
>delete delete ENUM : boolean
|
|
|
|
>delete ENUM : boolean
|
|
|
|
>ENUM : typeof ENUM
|
|
|
|
|
|
|
|
var ResultIsBoolean6 = delete delete delete (ENUM[0] + ENUM1[1]);
|
|
|
|
>ResultIsBoolean6 : boolean
|
|
|
|
>delete delete delete (ENUM[0] + ENUM1[1]) : boolean
|
|
|
|
>delete delete (ENUM[0] + ENUM1[1]) : boolean
|
|
|
|
>delete (ENUM[0] + ENUM1[1]) : boolean
|
|
|
|
>(ENUM[0] + ENUM1[1]) : string
|
|
|
|
>ENUM[0] + ENUM1[1] : string
|
|
|
|
>ENUM[0] : string
|
|
|
|
>ENUM : typeof ENUM
|
2014-10-07 07:27:22 +02:00
|
|
|
>ENUM1[1] : string
|
2014-08-15 23:33:16 +02:00
|
|
|
>ENUM1 : typeof ENUM1
|
|
|
|
|
|
|
|
// miss assignment operators
|
|
|
|
delete ENUM;
|
|
|
|
>delete ENUM : boolean
|
|
|
|
>ENUM : typeof ENUM
|
|
|
|
|
|
|
|
delete ENUM1;
|
|
|
|
>delete ENUM1 : boolean
|
|
|
|
>ENUM1 : typeof ENUM1
|
|
|
|
|
|
|
|
delete ENUM1[1];
|
|
|
|
>delete ENUM1[1] : boolean
|
2014-10-07 07:27:22 +02:00
|
|
|
>ENUM1[1] : string
|
2014-08-15 23:33:16 +02:00
|
|
|
>ENUM1 : typeof ENUM1
|
|
|
|
|
|
|
|
delete ENUM, ENUM1;
|
|
|
|
>delete ENUM, ENUM1 : typeof ENUM1
|
|
|
|
>delete ENUM : boolean
|
|
|
|
>ENUM : typeof ENUM
|
|
|
|
>ENUM1 : typeof ENUM1
|
|
|
|
|