TypeScript/tests/baselines/reference/objectLiteralShorthandPropertiesFunctionArgument.types
2015-04-13 14:29:37 -07:00

36 lines
2.1 KiB
Plaintext

=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts ===
var id: number = 10000;
>id : number, Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 0, 3))
>10000 : number
var name: string = "my name";
>name : string, Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 1, 3))
>"my name" : string
var person = { name, id };
>person : { name: string; id: number; }, Symbol(person, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 3))
>{ name, id } : { name: string; id: number; }
>name : string, Symbol(name, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 14))
>id : number, Symbol(id, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 3, 20))
function foo(p: { name: string; id: number }) { }
>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))
foo(person);
>foo(person) : void
>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))
var obj = { name: name, id: id };
>obj : { name: string; id: number; }, Symbol(obj, Decl(objectLiteralShorthandPropertiesFunctionArgument.ts, 9, 3))
>{ name: name, id: id } : { name: string; id: number; }
>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))