76 lines
4.8 KiB
Text
76 lines
4.8 KiB
Text
=== tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts ===
|
|
var id: number = 10000;
|
|
>id : number, Symbol(id,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,0,3))
|
|
>10000 : number
|
|
|
|
var name: string = "my name";
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,1,3))
|
|
>"my name" : string
|
|
|
|
var person: { name: string; id: number } = { name, id };
|
|
>person : { name: string; id: number; }, Symbol(person,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,3,3))
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,3,13))
|
|
>id : number, Symbol(id,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,3,27))
|
|
>{ name, id } : { name: string; id: number; }
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,3,44))
|
|
>id : number, Symbol(id,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,3,50))
|
|
|
|
function foo(obj: { name: string }): void { };
|
|
>foo : (obj: { name: string; }) => void, Symbol(foo,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,3,56))
|
|
>obj : { name: string; }, Symbol(obj,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,4,13))
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,4,19))
|
|
|
|
function bar(name: string, id: number) { return { name, id }; }
|
|
>bar : (name: string, id: number) => { name: string; id: number; }, Symbol(bar,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,4,46))
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,5,13))
|
|
>id : number, Symbol(id,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,5,26))
|
|
>{ name, id } : { name: string; id: number; }
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,5,49))
|
|
>id : number, Symbol(id,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,5,55))
|
|
|
|
function bar1(name: string, id: number) { return { name }; }
|
|
>bar1 : (name: string, id: number) => { name: string; }, Symbol(bar1,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,5,63))
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,6,14))
|
|
>id : number, Symbol(id,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,6,27))
|
|
>{ name } : { name: string; }
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,6,50))
|
|
|
|
function baz(name: string, id: number): { name: string; id: number } { return { name, id }; }
|
|
>baz : (name: string, id: number) => { name: string; id: number; }, Symbol(baz,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,6,60))
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,7,13))
|
|
>id : number, Symbol(id,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,7,26))
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,7,41))
|
|
>id : number, Symbol(id,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,7,55))
|
|
>{ name, id } : { name: string; id: number; }
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,7,79))
|
|
>id : number, Symbol(id,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,7,85))
|
|
|
|
foo(person);
|
|
>foo(person) : void
|
|
>foo : (obj: { name: string; }) => void, Symbol(foo,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,3,56))
|
|
>person : { name: string; id: number; }, Symbol(person,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,3,3))
|
|
|
|
var person1 = bar("Hello", 5);
|
|
>person1 : { name: string; id: number; }, Symbol(person1,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,10,3))
|
|
>bar("Hello", 5) : { name: string; id: number; }
|
|
>bar : (name: string, id: number) => { name: string; id: number; }, Symbol(bar,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,4,46))
|
|
>"Hello" : string
|
|
>5 : number
|
|
|
|
var person2: { name: string } = bar("Hello", 5);
|
|
>person2 : { name: string; }, Symbol(person2,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,11,3))
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,11,14))
|
|
>bar("Hello", 5) : { name: string; id: number; }
|
|
>bar : (name: string, id: number) => { name: string; id: number; }, Symbol(bar,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,4,46))
|
|
>"Hello" : string
|
|
>5 : number
|
|
|
|
var person3: { name: string; id: number } = bar("Hello", 5);
|
|
>person3 : { name: string; id: number; }, Symbol(person3,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,12,3))
|
|
>name : string, Symbol(name,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,12,14))
|
|
>id : number, Symbol(id,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,12,28))
|
|
>bar("Hello", 5) : { name: string; id: number; }
|
|
>bar : (name: string, id: number) => { name: string; id: number; }, Symbol(bar,Decl(objectLiteralShorthandPropertiesAssignmentES6.ts,4,46))
|
|
>"Hello" : string
|
|
>5 : number
|
|
|