TypeScript/tests/baselines/reference/stringPropertyAccess.types

38 lines
1.5 KiB
Text
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/types/primitives/string/stringPropertyAccess.ts ===
var x = '';
>x : string, Symbol(x,Decl(stringPropertyAccess.ts,0,3))
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
var a = x.charAt(0);
>a : string, Symbol(a,Decl(stringPropertyAccess.ts,1,3))
2014-08-15 23:33:16 +02:00
>x.charAt(0) : string
>x.charAt : (pos: number) => string, Symbol(String.charAt,Decl(lib.d.ts,279,23))
>x : string, Symbol(x,Decl(stringPropertyAccess.ts,0,3))
>charAt : (pos: number) => string, Symbol(String.charAt,Decl(lib.d.ts,279,23))
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
var b = x.hasOwnProperty('charAt');
>b : boolean, Symbol(b,Decl(stringPropertyAccess.ts,2,3))
2014-08-15 23:33:16 +02:00
>x.hasOwnProperty('charAt') : boolean
>x.hasOwnProperty : (v: string) => boolean, Symbol(Object.hasOwnProperty,Decl(lib.d.ts,105,22))
>x : string, Symbol(x,Decl(stringPropertyAccess.ts,0,3))
>hasOwnProperty : (v: string) => boolean, Symbol(Object.hasOwnProperty,Decl(lib.d.ts,105,22))
2015-04-13 21:36:11 +02:00
>'charAt' : string
2014-08-15 23:33:16 +02:00
var c = x['charAt'](0);
>c : string, Symbol(c,Decl(stringPropertyAccess.ts,4,3))
2014-08-15 23:33:16 +02:00
>x['charAt'](0) : string
>x['charAt'] : (pos: number) => string
>x : string, Symbol(x,Decl(stringPropertyAccess.ts,0,3))
>'charAt' : string, Symbol(String.charAt,Decl(lib.d.ts,279,23))
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
var e = x['hasOwnProperty']('toFixed');
>e : boolean, Symbol(e,Decl(stringPropertyAccess.ts,5,3))
2014-08-15 23:33:16 +02:00
>x['hasOwnProperty']('toFixed') : boolean
>x['hasOwnProperty'] : (v: string) => boolean
>x : string, Symbol(x,Decl(stringPropertyAccess.ts,0,3))
>'hasOwnProperty' : string, Symbol(Object.hasOwnProperty,Decl(lib.d.ts,105,22))
2015-04-13 21:36:11 +02:00
>'toFixed' : string
2014-08-15 23:33:16 +02:00