TypeScript/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types

36 lines
2.1 KiB
Plaintext
Raw Normal View History

2014-11-11 20:31:45 +01:00
=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts ===
var id: number = 10000;
2015-04-13 23:01:57 +02:00
>id : number, Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 0, 3))
2015-04-13 21:36:11 +02:00
>10000 : number
2014-11-11 20:31:45 +01:00
var name: string = "my name";
2015-04-13 23:01:57 +02:00
>name : string, Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 1, 3))
2015-04-13 21:36:11 +02:00
>"my name" : string
2014-11-11 20:31:45 +01:00
var person = { name, id };
2015-04-13 23:01:57 +02:00
>person : { name: string; id: number; }, Symbol(person, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 3))
2014-11-11 20:31:45 +01:00
>{ name, id } : { name: string; id: number; }
2015-04-13 23:01:57 +02:00
>name : string, Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 14))
>id : number, Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 20))
2014-11-11 20:31:45 +01:00
function foo(p: { name: string; id: number }) { }
2015-04-13 23:01:57 +02:00
>foo : (p: { name: string; id: number; }) => void, Symbol(foo, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 26))
>p : { name: string; id: number; }, Symbol(p, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 5, 13))
>name : string, Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 5, 17))
>id : number, Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 5, 31))
2014-11-11 20:31:45 +01:00
foo(person);
>foo(person) : void
2015-04-13 23:01:57 +02:00
>foo : (p: { name: string; id: number; }) => void, Symbol(foo, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 26))
>person : { name: string; id: number; }, Symbol(person, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 3))
2014-11-11 20:31:45 +01:00
var obj = { name: name, id: id };
2015-04-13 23:01:57 +02:00
>obj : { name: string; id: number; }, Symbol(obj, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 9, 3))
2014-11-11 20:31:45 +01:00
>{ name: name, id: id } : { name: string; id: number; }
2015-04-13 23:01:57 +02:00
>name : string, Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 9, 11))
>name : string, Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 1, 3))
>id : number, Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 9, 23))
>id : number, Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 0, 3))
2014-11-11 20:31:45 +01:00