TypeScript/tests/baselines/reference/deleteOperatorWithStringType.types

173 lines
3.7 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/expressions/unaryOperators/deleteOperator/deleteOperatorWithStringType.ts ===
// delete operator on string type
var STRING: string;
>STRING : string
2014-08-15 23:33:16 +02:00
var STRING1: string[] = ["", "abc"];
>STRING1 : string[]
2014-08-15 23:33:16 +02:00
>["", "abc"] : string[]
2015-04-13 21:36:11 +02:00
>"" : string
>"abc" : string
2014-08-15 23:33:16 +02:00
function foo(): string { return "abc"; }
>foo : () => string
2015-04-13 21:36:11 +02:00
>"abc" : string
2014-08-15 23:33:16 +02:00
class A {
>A : A
2014-08-15 23:33:16 +02:00
public a: string;
>a : string
2014-08-15 23:33:16 +02:00
static foo() { return ""; }
>foo : () => string
2015-04-13 21:36:11 +02:00
>"" : string
2014-08-15 23:33:16 +02:00
}
module M {
>M : typeof M
2014-08-15 23:33:16 +02:00
export var n: string;
>n : string
2014-08-15 23:33:16 +02:00
}
var objA = new A();
>objA : A
2014-08-15 23:33:16 +02:00
>new A() : A
>A : typeof A
2014-08-15 23:33:16 +02:00
// string type var
var ResultIsBoolean1 = delete STRING;
>ResultIsBoolean1 : boolean
2014-08-15 23:33:16 +02:00
>delete STRING : boolean
>STRING : string
2014-08-15 23:33:16 +02:00
var ResultIsBoolean2 = delete STRING1;
>ResultIsBoolean2 : boolean
2014-08-15 23:33:16 +02:00
>delete STRING1 : boolean
>STRING1 : string[]
2014-08-15 23:33:16 +02:00
// string type literal
var ResultIsBoolean3 = delete "";
>ResultIsBoolean3 : boolean
2014-08-15 23:33:16 +02:00
>delete "" : boolean
2015-04-13 21:36:11 +02:00
>"" : string
2014-08-15 23:33:16 +02:00
var ResultIsBoolean4 = delete { x: "", y: "" };
>ResultIsBoolean4 : boolean
2014-08-15 23:33:16 +02:00
>delete { x: "", y: "" } : boolean
>{ x: "", y: "" } : { x: string; y: string; }
>x : string
2015-04-13 21:36:11 +02:00
>"" : string
>y : string
2015-04-13 21:36:11 +02:00
>"" : string
2014-08-15 23:33:16 +02:00
var ResultIsBoolean5 = delete { x: "", y: (s: string) => { return s; } };
>ResultIsBoolean5 : boolean
2014-08-15 23:33:16 +02:00
>delete { x: "", y: (s: string) => { return s; } } : boolean
>{ x: "", y: (s: string) => { return s; } } : { x: string; y: (s: string) => string; }
>x : string
2015-04-13 21:36:11 +02:00
>"" : string
>y : (s: string) => string
2014-08-15 23:33:16 +02:00
>(s: string) => { return s; } : (s: string) => string
>s : string
>s : string
2014-08-15 23:33:16 +02:00
// string type expressions
var ResultIsBoolean6 = delete objA.a;
>ResultIsBoolean6 : boolean
2014-08-15 23:33:16 +02:00
>delete objA.a : boolean
>objA.a : string
>objA : A
>a : string
2014-08-15 23:33:16 +02:00
var ResultIsBoolean7 = delete M.n;
>ResultIsBoolean7 : boolean
2014-08-15 23:33:16 +02:00
>delete M.n : boolean
>M.n : string
>M : typeof M
>n : string
2014-08-15 23:33:16 +02:00
var ResultIsBoolean8 = delete STRING1[0];
>ResultIsBoolean8 : boolean
2014-08-15 23:33:16 +02:00
>delete STRING1[0] : boolean
>STRING1[0] : string
>STRING1 : string[]
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
var ResultIsBoolean9 = delete foo();
>ResultIsBoolean9 : boolean
2014-08-15 23:33:16 +02:00
>delete foo() : boolean
>foo() : string
>foo : () => string
2014-08-15 23:33:16 +02:00
var ResultIsBoolean10 = delete A.foo();
>ResultIsBoolean10 : boolean
2014-08-15 23:33:16 +02:00
>delete A.foo() : boolean
>A.foo() : string
>A.foo : () => string
>A : typeof A
>foo : () => string
2014-08-15 23:33:16 +02:00
var ResultIsBoolean11 = delete (STRING + STRING);
>ResultIsBoolean11 : boolean
2014-08-15 23:33:16 +02:00
>delete (STRING + STRING) : boolean
>(STRING + STRING) : string
>STRING + STRING : string
>STRING : string
>STRING : string
2014-08-15 23:33:16 +02:00
var ResultIsBoolean12 = delete STRING.charAt(0);
>ResultIsBoolean12 : boolean
2014-08-15 23:33:16 +02:00
>delete STRING.charAt(0) : boolean
>STRING.charAt(0) : string
>STRING.charAt : (pos: number) => string
>STRING : string
>charAt : (pos: number) => string
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
// multiple delete operator
var ResultIsBoolean13 = delete delete STRING;
>ResultIsBoolean13 : boolean
2014-08-15 23:33:16 +02:00
>delete delete STRING : boolean
>delete STRING : boolean
>STRING : string
2014-08-15 23:33:16 +02:00
var ResultIsBoolean14 = delete delete delete (STRING + STRING);
>ResultIsBoolean14 : boolean
2014-08-15 23:33:16 +02:00
>delete delete delete (STRING + STRING) : boolean
>delete delete (STRING + STRING) : boolean
>delete (STRING + STRING) : boolean
>(STRING + STRING) : string
>STRING + STRING : string
>STRING : string
>STRING : string
2014-08-15 23:33:16 +02:00
// miss assignment operators
delete "";
>delete "" : boolean
2015-04-13 21:36:11 +02:00
>"" : string
2014-08-15 23:33:16 +02:00
delete STRING;
>delete STRING : boolean
>STRING : string
2014-08-15 23:33:16 +02:00
delete STRING1;
>delete STRING1 : boolean
>STRING1 : string[]
2014-08-15 23:33:16 +02:00
delete foo();
>delete foo() : boolean
>foo() : string
>foo : () => string
2014-08-15 23:33:16 +02:00
delete objA.a,M.n;
>delete objA.a,M.n : string
>delete objA.a : boolean
>objA.a : string
>objA : A
>a : string
>M.n : string
>M : typeof M
>n : string
2014-08-15 23:33:16 +02:00