TypeScript/tests/baselines/reference/optionalAccessorsInInterface1.types

58 lines
1.8 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/optionalAccessorsInInterface1.ts ===
interface MyPropertyDescriptor {
>MyPropertyDescriptor : MyPropertyDescriptor
2014-08-15 23:33:16 +02:00
get? (): any;
>get : () => any
2014-08-15 23:33:16 +02:00
set? (v: any): void;
>set : (v: any) => void
>v : any
2014-08-15 23:33:16 +02:00
}
declare function defineMyProperty(o: any, p: string, attributes: MyPropertyDescriptor): any;
>defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any
>o : any
>p : string
>attributes : MyPropertyDescriptor
>MyPropertyDescriptor : MyPropertyDescriptor
2014-08-15 23:33:16 +02:00
defineMyProperty({}, "name", { get: function () { return 5; } });
>defineMyProperty({}, "name", { get: function () { return 5; } }) : any
>defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any
2014-08-15 23:33:16 +02:00
>{} : {}
2015-04-13 21:36:11 +02:00
>"name" : string
2015-01-24 17:04:23 +01:00
>{ get: function () { return 5; } } : { get: () => number; }
>get : () => number
2014-08-15 23:33:16 +02:00
>function () { return 5; } : () => number
2015-04-13 21:36:11 +02:00
>5 : number
2014-08-15 23:33:16 +02:00
interface MyPropertyDescriptor2 {
>MyPropertyDescriptor2 : MyPropertyDescriptor2
2014-08-15 23:33:16 +02:00
get?: () => any;
>get : () => any
2014-08-15 23:33:16 +02:00
set?: (v: any) => void;
>set : (v: any) => void
>v : any
2014-08-15 23:33:16 +02:00
}
declare function defineMyProperty2(o: any, p: string, attributes: MyPropertyDescriptor2): any;
>defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any
>o : any
>p : string
>attributes : MyPropertyDescriptor2
>MyPropertyDescriptor2 : MyPropertyDescriptor2
2014-08-15 23:33:16 +02:00
defineMyProperty2({}, "name", { get: function () { return 5; } });
>defineMyProperty2({}, "name", { get: function () { return 5; } }) : any
>defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any
2014-08-15 23:33:16 +02:00
>{} : {}
2015-04-13 21:36:11 +02:00
>"name" : string
2015-01-24 17:04:23 +01:00
>{ get: function () { return 5; } } : { get: () => number; }
>get : () => number
2014-08-15 23:33:16 +02:00
>function () { return 5; } : () => number
2015-04-13 21:36:11 +02:00
>5 : number
2014-08-15 23:33:16 +02:00