Object literal formatting (#16007)

* consolidate object literal formatting

* accept baselines
This commit is contained in:
Arthur Ozga
2017-05-23 14:22:01 -07:00
committed by Mohamed Hegazy
parent 2f65b2c160
commit b4ee6b19aa
34 changed files with 172 additions and 173 deletions
+2 -3
View File
@@ -1064,7 +1064,7 @@ namespace ts {
}
else {
write("{");
emitList(node, elements, getEmitFlags(node) & EmitFlags.SingleLine ? ListFormat.ObjectBindingPatternElements : ListFormat.ObjectBindingPatternElementsWithSpaceBetweenBraces);
emitList(node, elements, ListFormat.ObjectBindingPatternElements);
write("}");
}
}
@@ -3019,8 +3019,7 @@ namespace ts {
TupleTypeElements = CommaDelimited | SpaceBetweenSiblings | SingleLine | Indented,
UnionTypeConstituents = BarDelimited | SpaceBetweenSiblings | SingleLine,
IntersectionTypeConstituents = AmpersandDelimited | SpaceBetweenSiblings | SingleLine,
ObjectBindingPatternElements = SingleLine | CommaDelimited | SpaceBetweenSiblings,
ObjectBindingPatternElementsWithSpaceBetweenBraces = SingleLine | AllowTrailingComma | SpaceBetweenBraces | CommaDelimited | SpaceBetweenSiblings,
ObjectBindingPatternElements = SingleLine | AllowTrailingComma | SpaceBetweenBraces | CommaDelimited | SpaceBetweenSiblings,
ArrayBindingPatternElements = SingleLine | AllowTrailingComma | CommaDelimited | SpaceBetweenSiblings,
ObjectLiteralExpressionProperties = PreserveLines | CommaDelimited | SpaceBetweenSiblings | SpaceBetweenBraces | Indented | Braces,
ArrayLiteralExpressionElements = PreserveLines | CommaDelimited | SpaceBetweenSiblings | AllowTrailingComma | Indented | SquareBrackets,
@@ -83,25 +83,25 @@ var p5 = ([a = 1]) => { };
>1 : 1
var p6 = ({ a }) => { };
>p6 : ({a}: { a: any; }) => void
>({ a }) => { } : ({a}: { a: any; }) => void
>p6 : ({ a }: { a: any; }) => void
>({ a }) => { } : ({ a }: { a: any; }) => void
>a : any
var p7 = ({ a: { b } }) => { };
>p7 : ({a: {b}}: { a: { b: any; }; }) => void
>({ a: { b } }) => { } : ({a: {b}}: { a: { b: any; }; }) => void
>p7 : ({ a: { b } }: { a: { b: any; }; }) => void
>({ a: { b } }) => { } : ({ a: { b } }: { a: { b: any; }; }) => void
>a : any
>b : any
var p8 = ({ a = 1 }) => { };
>p8 : ({a}: { a?: number; }) => void
>({ a = 1 }) => { } : ({a}: { a?: number; }) => void
>p8 : ({ a }: { a?: number; }) => void
>({ a = 1 }) => { } : ({ a }: { a?: number; }) => void
>a : number
>1 : 1
var p9 = ({ a: { b = 1 } = { b: 1 } }) => { };
>p9 : ({a: {b}}: { a?: { b?: number; }; }) => void
>({ a: { b = 1 } = { b: 1 } }) => { } : ({a: {b}}: { a?: { b?: number; }; }) => void
>p9 : ({ a: { b } }: { a?: { b?: number; }; }) => void
>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b } }: { a?: { b?: number; }; }) => void
>a : any
>b : number
>1 : 1
@@ -110,8 +110,8 @@ var p9 = ({ a: { b = 1 } = { b: 1 } }) => { };
>1 : 1
var p10 = ([{ value, done }]) => { };
>p10 : ([{value, done}]: [{ value: any; done: any; }]) => void
>([{ value, done }]) => { } : ([{value, done}]: [{ value: any; done: any; }]) => void
>p10 : ([{ value, done }]: [{ value: any; done: any; }]) => void
>([{ value, done }]) => { } : ([{ value, done }]: [{ value: any; done: any; }]) => void
>value : any
>done : any
@@ -7,7 +7,7 @@ interface Show {
>x : number
}
function f({ show = v => v.toString() }: Show) {}
>f : ({show}: Show) => void
>f : ({ show }: Show) => void
>show : (x: number) => string
>v => v.toString() : (v: number) => string
>v : number
@@ -18,7 +18,7 @@ function f({ show = v => v.toString() }: Show) {}
>Show : Show
function f2({ "show": showRename = v => v.toString() }: Show) {}
>f2 : ({"show": showRename}: Show) => void
>f2 : ({ "show": showRename }: Show) => void
>showRename : (x: number) => string
>v => v.toString() : (v: number) => string
>v : number
@@ -29,7 +29,7 @@ function f2({ "show": showRename = v => v.toString() }: Show) {}
>Show : Show
function f3({ ["show"]: showRename = v => v.toString() }: Show) {}
>f3 : ({["show"]: showRename}: Show) => void
>f3 : ({ ["show"]: showRename }: Show) => void
>"show" : "show"
>showRename : (x: number) => string
>v => v.toString() : (v: number) => string
@@ -48,7 +48,7 @@ interface Nested {
>Show : Show
}
function ff({ nested = { show: v => v.toString() } }: Nested) {}
>ff : ({nested}: Nested) => void
>ff : ({ nested }: Nested) => void
>nested : Show
>{ show: v => v.toString() } : { show: (v: number) => string; }
>show : (v: number) => string
@@ -67,7 +67,7 @@ interface Tuples {
>prop : [string, number]
}
function g({ prop = ["hello", 1234] }: Tuples) {}
>g : ({prop}: Tuples) => void
>g : ({ prop }: Tuples) => void
>prop : [string, number]
>["hello", 1234] : [string, number]
>"hello" : "hello"
@@ -81,7 +81,7 @@ interface StringUnion {
>prop : "foo" | "bar"
}
function h({ prop = "foo" }: StringUnion) {}
>h : ({prop}: StringUnion) => void
>h : ({ prop }: StringUnion) => void
>prop : "foo" | "bar"
>"foo" : "foo"
>StringUnion : StringUnion
@@ -7,7 +7,7 @@ interface Show {
>x : number
}
function f({ show: showRename = v => v }: Show) {}
>f : ({show: showRename}: Show) => void
>f : ({ show: showRename }: Show) => void
>show : any
>showRename : ((x: number) => string) | ((v: number) => number)
>v => v : (v: number) => number
@@ -16,7 +16,7 @@ function f({ show: showRename = v => v }: Show) {}
>Show : Show
function f2({ "show": showRename = v => v }: Show) {}
>f2 : ({"show": showRename}: Show) => void
>f2 : ({ "show": showRename }: Show) => void
>showRename : ((x: number) => string) | ((v: number) => number)
>v => v : (v: number) => number
>v : number
@@ -24,7 +24,7 @@ function f2({ "show": showRename = v => v }: Show) {}
>Show : Show
function f3({ ["show"]: showRename = v => v }: Show) {}
>f3 : ({["show"]: showRename}: Show) => void
>f3 : ({ ["show"]: showRename }: Show) => void
>"show" : "show"
>showRename : ((x: number) => string) | ((v: number) => number)
>v => v : (v: number) => number
@@ -40,7 +40,7 @@ interface Nested {
>Show : Show
}
function ff({ nested: nestedRename = { show: v => v } }: Nested) {}
>ff : ({nested: nestedRename}: Nested) => void
>ff : ({ nested: nestedRename }: Nested) => void
>nested : any
>nestedRename : Show | { show: (v: number) => number; }
>{ show: v => v } : { show: (v: number) => number; }
@@ -79,7 +79,7 @@ interface Tuples {
>prop : [string, number]
}
function g({ prop = [101, 1234] }: Tuples) {}
>g : ({prop}: Tuples) => void
>g : ({ prop }: Tuples) => void
>prop : [string, number] | [number, number]
>[101, 1234] : [number, number]
>101 : 101
@@ -93,7 +93,7 @@ interface StringUnion {
>prop : "foo" | "bar"
}
function h({ prop = "baz" }: StringUnion) {}
>h : ({prop}: StringUnion) => void
>h : ({ prop }: StringUnion) => void
>prop : "foo" | "bar" | "baz"
>"baz" : "baz"
>StringUnion : StringUnion
@@ -175,8 +175,8 @@
// destructuring parameters (with defaults too!)
(({ q }) => q)({ q : 13 });
>(({ q }) => q)({ q : 13 }) : number
>(({ q }) => q) : ({q}: { q: number; }) => number
>({ q }) => q : ({q}: { q: number; }) => number
>(({ q }) => q) : ({ q }: { q: number; }) => number
>({ q }) => q : ({ q }: { q: number; }) => number
>q : number
>q : number
>{ q : 13 } : { q: number; }
@@ -185,8 +185,8 @@
(({ p = 14 }) => p)({ p : 15 });
>(({ p = 14 }) => p)({ p : 15 }) : number
>(({ p = 14 }) => p) : ({p}: { p: number; }) => number
>({ p = 14 }) => p : ({p}: { p: number; }) => number
>(({ p = 14 }) => p) : ({ p }: { p: number; }) => number
>({ p = 14 }) => p : ({ p }: { p: number; }) => number
>p : number
>14 : 14
>p : number
@@ -196,8 +196,8 @@
(({ r = 17 } = { r: 18 }) => r)({r : 19});
>(({ r = 17 } = { r: 18 }) => r)({r : 19}) : number
>(({ r = 17 } = { r: 18 }) => r) : ({r}?: { r: number; }) => number
>({ r = 17 } = { r: 18 }) => r : ({r}?: { r: number; }) => number
>(({ r = 17 } = { r: 18 }) => r) : ({ r }?: { r: number; }) => number
>({ r = 17 } = { r: 18 }) => r : ({ r }?: { r: number; }) => number
>r : number
>17 : 17
>{ r: 18 } : { r: number; }
@@ -210,8 +210,8 @@
(({ u = 22 } = { u: 23 }) => u)();
>(({ u = 22 } = { u: 23 }) => u)() : number
>(({ u = 22 } = { u: 23 }) => u) : ({u}?: { u?: number; }) => number
>({ u = 22 } = { u: 23 }) => u : ({u}?: { u?: number; }) => number
>(({ u = 22 } = { u: 23 }) => u) : ({ u }?: { u?: number; }) => number
>({ u = 22 } = { u: 23 }) => u : ({ u }?: { u?: number; }) => number
>u : number
>22 : 22
>{ u: 23 } : { u?: number; }
@@ -12,7 +12,7 @@
>map : { <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): U[]; <U>(callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): U[]; }
({ x }) => x
>({ x }) => x : (this: void, {x}: { x: number; }) => number
>({ x }) => x : (this: void, { x }: { x: number; }) => number
>x : number
>x : number
@@ -1,7 +1,7 @@
=== tests/cases/compiler/declarationEmitBindingPatterns.ts ===
const k = ({x: z = 'y'}) => { }
>k : ({x: z}: { x?: string; }) => void
>({x: z = 'y'}) => { } : ({x: z}: { x?: string; }) => void
>k : ({ x: z }: { x?: string; }) => void
>({x: z = 'y'}) => { } : ({ x: z }: { x?: string; }) => void
>x : any
>z : string
>'y' : "y"
@@ -10,7 +10,7 @@ var a;
>a : any
function f({} = a, [] = a, { p: {} = a} = a) {
>f : ({}?: any, []?: any, {p: {}}?: any) => void
>f : ({}?: any, []?: any, { p: {} }?: any) => void
>a : any
>a : any
>p : any
@@ -12,7 +12,7 @@ function far([a, [b], [[c]]]: [number, boolean[], string[][]]): void { }
>c : string
function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { }
>bar : ({a1, b1, c1}: { a1: number; b1: boolean; c1: string; }) => void
>bar : ({ a1, b1, c1 }: { a1: number; b1: boolean; c1: string; }) => void
>a1 : number
>b1 : boolean
>c1 : string
@@ -21,7 +21,7 @@ function bar({a1, b1, c1}: { a1: number, b1: boolean, c1: string }): void { }
>c1 : string
function baz({a2, b2: {b1, c1}}: { a2: number, b2: { b1: boolean, c1: string } }): void { }
>baz : ({a2, b2: {b1, c1}}: { a2: number; b2: { b1: boolean; c1: string; }; }) => void
>baz : ({ a2, b2: { b1, c1 } }: { a2: number; b2: { b1: boolean; c1: string; }; }) => void
>a2 : number
>b2 : any
>b1 : boolean
@@ -11,7 +11,7 @@ function foo(...rest: any[]) {
}
function foo2( { x, y, z }?: { x: string; y: number; z: boolean });
>foo2 : ({x, y, z}?: { x: string; y: number; z: boolean; }) => any
>foo2 : ({ x, y, z }?: { x: string; y: number; z: boolean; }) => any
>x : string
>y : number
>z : boolean
@@ -20,7 +20,7 @@ function foo2( { x, y, z }?: { x: string; y: number; z: boolean });
>z : boolean
function foo2(...rest: any[]) {
>foo2 : ({x, y, z}?: { x: string; y: number; z: boolean; }) => any
>foo2 : ({ x, y, z }?: { x: string; y: number; z: boolean; }) => any
>rest : any[]
}
@@ -1,13 +1,13 @@
=== tests/cases/compiler/destructureOptionalParameter.ts ===
declare function f1({ a, b }?: { a: number, b: string }): void;
>f1 : ({a, b}?: { a: number; b: string; } | undefined) => void
>f1 : ({ a, b }?: { a: number; b: string; } | undefined) => void
>a : number
>b : string
>a : number
>b : string
function f2({ a, b }: { a: number, b: number } = { a: 0, b: 0 }) {
>f2 : ({a, b}?: { a: number; b: number; }) => void
>f2 : ({ a, b }?: { a: number; b: number; }) => void
>a : number
>b : number
>a : number
@@ -38,7 +38,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(47,13): error TS2463: A binding pattern parameter cannot be optional in an implementation signature.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(55,7): error TS2420: Class 'C4' incorrectly implements interface 'F2'.
Types of property 'd4' are incompatible.
Type '({x, y, c}: { x: any; y: any; c: any; }) => void' is not assignable to type '({x, y, z}?: { x: any; y: any; z: any; }) => any'.
Type '({ x, y, c }: { x: any; y: any; c: any; }) => void' is not assignable to type '({ x, y, z }?: { x: any; y: any; z: any; }) => any'.
Types of parameters '__0' and '__0' are incompatible.
Type '{ x: any; y: any; z: any; }' is not assignable to type '{ x: any; y: any; c: any; }'.
Property 'c' is missing in type '{ x: any; y: any; z: any; }'.
@@ -162,7 +162,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
~~
!!! error TS2420: Class 'C4' incorrectly implements interface 'F2'.
!!! error TS2420: Types of property 'd4' are incompatible.
!!! error TS2420: Type '({x, y, c}: { x: any; y: any; c: any; }) => void' is not assignable to type '({x, y, z}?: { x: any; y: any; z: any; }) => any'.
!!! error TS2420: Type '({ x, y, c }: { x: any; y: any; c: any; }) => void' is not assignable to type '({ x, y, z }?: { x: any; y: any; z: any; }) => any'.
!!! error TS2420: Types of parameters '__0' and '__0' are incompatible.
!!! error TS2420: Type '{ x: any; y: any; z: any; }' is not assignable to type '{ x: any; y: any; c: any; }'.
!!! error TS2420: Property 'c' is missing in type '{ x: any; y: any; z: any; }'.
@@ -10,13 +10,13 @@ interface ISomething {
}
function foo({}, {foo, bar}: ISomething) {}
>foo : ({}: {}, {foo, bar}: ISomething) => void
>foo : ({}: {}, { foo, bar }: ISomething) => void
>foo : string
>bar : string
>ISomething : ISomething
function baz([], {foo, bar}: ISomething) {}
>baz : ([]: any[], {foo, bar}: ISomething) => void
>baz : ([]: any[], { foo, bar }: ISomething) => void
>foo : string
>bar : string
>ISomething : ISomething
@@ -10,13 +10,13 @@ interface ISomething {
}
function foo({}, {foo, bar}: ISomething) {}
>foo : ({}: {}, {foo, bar}: ISomething) => void
>foo : ({}: {}, { foo, bar }: ISomething) => void
>foo : string
>bar : string
>ISomething : ISomething
function baz([], {foo, bar}: ISomething) {}
>baz : ([]: any[], {foo, bar}: ISomething) => void
>baz : ([]: any[], { foo, bar }: ISomething) => void
>foo : string
>bar : string
>ISomething : ISomething
@@ -36,7 +36,7 @@ genericFunction(genericObject, ({greeting}) => {
>genericFunction(genericObject, ({greeting}) => { var s = greeting.toLocaleLowerCase(); // Greeting should be of type string}) : void
>genericFunction : <T>(object: GenericClass<T>, callback: (payload: T) => void) => void
>genericObject : GenericClass<{ greeting: string; }>
>({greeting}) => { var s = greeting.toLocaleLowerCase(); // Greeting should be of type string} : ({greeting}: { greeting: string; }) => void
>({greeting}) => { var s = greeting.toLocaleLowerCase(); // Greeting should be of type string} : ({ greeting }: { greeting: string; }) => void
>greeting : string
var s = greeting.toLocaleLowerCase(); // Greeting should be of type string
@@ -1,13 +1,13 @@
=== tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers.ts ===
// (arg: { x: any, y: any }) => void
function f1({ x, y }) { }
>f1 : ({x, y}: { x: any; y: any; }) => void
>f1 : ({ x, y }: { x: any; y: any; }) => void
>x : any
>y : any
f1({ x: 1, y: 1 });
>f1({ x: 1, y: 1 }) : void
>f1 : ({x, y}: { x: any; y: any; }) => void
>f1 : ({ x, y }: { x: any; y: any; }) => void
>{ x: 1, y: 1 } : { x: number; y: number; }
>x : number
>1 : 1
@@ -16,21 +16,21 @@ f1({ x: 1, y: 1 });
// (arg: { x: any, y?: number }) => void
function f2({ x, y = 0 }) { }
>f2 : ({x, y}: { x: any; y?: number; }) => void
>f2 : ({ x, y }: { x: any; y?: number; }) => void
>x : any
>y : number
>0 : 0
f2({ x: 1 });
>f2({ x: 1 }) : void
>f2 : ({x, y}: { x: any; y?: number; }) => void
>f2 : ({ x, y }: { x: any; y?: number; }) => void
>{ x: 1 } : { x: number; }
>x : number
>1 : 1
f2({ x: 1, y: 1 });
>f2({ x: 1, y: 1 }) : void
>f2 : ({x, y}: { x: any; y?: number; }) => void
>f2 : ({ x, y }: { x: any; y?: number; }) => void
>{ x: 1, y: 1 } : { x: number; y: number; }
>x : number
>1 : 1
@@ -39,7 +39,7 @@ f2({ x: 1, y: 1 });
// (arg: { x?: number, y?: number }) => void
function f3({ x = 0, y = 0 }) { }
>f3 : ({x, y}: { x?: number; y?: number; }) => void
>f3 : ({ x, y }: { x?: number; y?: number; }) => void
>x : number
>0 : 0
>y : number
@@ -47,26 +47,26 @@ function f3({ x = 0, y = 0 }) { }
f3({});
>f3({}) : void
>f3 : ({x, y}: { x?: number; y?: number; }) => void
>f3 : ({ x, y }: { x?: number; y?: number; }) => void
>{} : {}
f3({ x: 1 });
>f3({ x: 1 }) : void
>f3 : ({x, y}: { x?: number; y?: number; }) => void
>f3 : ({ x, y }: { x?: number; y?: number; }) => void
>{ x: 1 } : { x: number; }
>x : number
>1 : 1
f3({ y: 1 });
>f3({ y: 1 }) : void
>f3 : ({x, y}: { x?: number; y?: number; }) => void
>f3 : ({ x, y }: { x?: number; y?: number; }) => void
>{ y: 1 } : { y: number; }
>y : number
>1 : 1
f3({ x: 1, y: 1 });
>f3({ x: 1, y: 1 }) : void
>f3 : ({x, y}: { x?: number; y?: number; }) => void
>f3 : ({ x, y }: { x?: number; y?: number; }) => void
>{ x: 1, y: 1 } : { x: number; y: number; }
>x : number
>1 : 1
@@ -75,7 +75,7 @@ f3({ x: 1, y: 1 });
// (arg?: { x: number, y: number }) => void
function f4({ x, y } = { x: 0, y: 0 }) { }
>f4 : ({x, y}?: { x: number; y: number; }) => void
>f4 : ({ x, y }?: { x: number; y: number; }) => void
>x : number
>y : number
>{ x: 0, y: 0 } : { x: number; y: number; }
@@ -86,11 +86,11 @@ function f4({ x, y } = { x: 0, y: 0 }) { }
f4();
>f4() : void
>f4 : ({x, y}?: { x: number; y: number; }) => void
>f4 : ({ x, y }?: { x: number; y: number; }) => void
f4({ x: 1, y: 1 });
>f4({ x: 1, y: 1 }) : void
>f4 : ({x, y}?: { x: number; y: number; }) => void
>f4 : ({ x, y }?: { x: number; y: number; }) => void
>{ x: 1, y: 1 } : { x: number; y: number; }
>x : number
>1 : 1
@@ -99,7 +99,7 @@ f4({ x: 1, y: 1 });
// (arg?: { x: number, y?: number }) => void
function f5({ x, y = 0 } = { x: 0 }) { }
>f5 : ({x, y}?: { x: number; y?: number; }) => void
>f5 : ({ x, y }?: { x: number; y?: number; }) => void
>x : number
>y : number
>0 : 0
@@ -109,18 +109,18 @@ function f5({ x, y = 0 } = { x: 0 }) { }
f5();
>f5() : void
>f5 : ({x, y}?: { x: number; y?: number; }) => void
>f5 : ({ x, y }?: { x: number; y?: number; }) => void
f5({ x: 1 });
>f5({ x: 1 }) : void
>f5 : ({x, y}?: { x: number; y?: number; }) => void
>f5 : ({ x, y }?: { x: number; y?: number; }) => void
>{ x: 1 } : { x: number; }
>x : number
>1 : 1
f5({ x: 1, y: 1 });
>f5({ x: 1, y: 1 }) : void
>f5 : ({x, y}?: { x: number; y?: number; }) => void
>f5 : ({ x, y }?: { x: number; y?: number; }) => void
>{ x: 1, y: 1 } : { x: number; y: number; }
>x : number
>1 : 1
@@ -129,7 +129,7 @@ f5({ x: 1, y: 1 });
// (arg?: { x?: number, y?: number }) => void
function f6({ x = 0, y = 0 } = {}) { }
>f6 : ({x, y}?: { x?: number; y?: number; }) => void
>f6 : ({ x, y }?: { x?: number; y?: number; }) => void
>x : number
>0 : 0
>y : number
@@ -138,30 +138,30 @@ function f6({ x = 0, y = 0 } = {}) { }
f6();
>f6() : void
>f6 : ({x, y}?: { x?: number; y?: number; }) => void
>f6 : ({ x, y }?: { x?: number; y?: number; }) => void
f6({});
>f6({}) : void
>f6 : ({x, y}?: { x?: number; y?: number; }) => void
>f6 : ({ x, y }?: { x?: number; y?: number; }) => void
>{} : {}
f6({ x: 1 });
>f6({ x: 1 }) : void
>f6 : ({x, y}?: { x?: number; y?: number; }) => void
>f6 : ({ x, y }?: { x?: number; y?: number; }) => void
>{ x: 1 } : { x: number; }
>x : number
>1 : 1
f6({ y: 1 });
>f6({ y: 1 }) : void
>f6 : ({x, y}?: { x?: number; y?: number; }) => void
>f6 : ({ x, y }?: { x?: number; y?: number; }) => void
>{ y: 1 } : { y: number; }
>y : number
>1 : 1
f6({ x: 1, y: 1 });
>f6({ x: 1, y: 1 }) : void
>f6 : ({x, y}?: { x?: number; y?: number; }) => void
>f6 : ({ x, y }?: { x?: number; y?: number; }) => void
>{ x: 1, y: 1 } : { x: number; y: number; }
>x : number
>1 : 1
@@ -170,7 +170,7 @@ f6({ x: 1, y: 1 });
// (arg?: { a: { x?: number, y?: number } }) => void
function f7({ a: { x = 0, y = 0 } } = { a: {} }) { }
>f7 : ({a: {x, y}}?: { a: { x?: number; y?: number; }; }) => void
>f7 : ({ a: { x, y } }?: { a: { x?: number; y?: number; }; }) => void
>a : any
>x : number
>0 : 0
@@ -182,18 +182,18 @@ function f7({ a: { x = 0, y = 0 } } = { a: {} }) { }
f7();
>f7() : void
>f7 : ({a: {x, y}}?: { a: { x?: number; y?: number; }; }) => void
>f7 : ({ a: { x, y } }?: { a: { x?: number; y?: number; }; }) => void
f7({ a: {} });
>f7({ a: {} }) : void
>f7 : ({a: {x, y}}?: { a: { x?: number; y?: number; }; }) => void
>f7 : ({ a: { x, y } }?: { a: { x?: number; y?: number; }; }) => void
>{ a: {} } : { a: {}; }
>a : {}
>{} : {}
f7({ a: { x: 1 } });
>f7({ a: { x: 1 } }) : void
>f7 : ({a: {x, y}}?: { a: { x?: number; y?: number; }; }) => void
>f7 : ({ a: { x, y } }?: { a: { x?: number; y?: number; }; }) => void
>{ a: { x: 1 } } : { a: { x: number; }; }
>a : { x: number; }
>{ x: 1 } : { x: number; }
@@ -202,7 +202,7 @@ f7({ a: { x: 1 } });
f7({ a: { y: 1 } });
>f7({ a: { y: 1 } }) : void
>f7 : ({a: {x, y}}?: { a: { x?: number; y?: number; }; }) => void
>f7 : ({ a: { x, y } }?: { a: { x?: number; y?: number; }; }) => void
>{ a: { y: 1 } } : { a: { y: number; }; }
>a : { y: number; }
>{ y: 1 } : { y: number; }
@@ -211,7 +211,7 @@ f7({ a: { y: 1 } });
f7({ a: { x: 1, y: 1 } });
>f7({ a: { x: 1, y: 1 } }) : void
>f7 : ({a: {x, y}}?: { a: { x?: number; y?: number; }; }) => void
>f7 : ({ a: { x, y } }?: { a: { x?: number; y?: number; }; }) => void
>{ a: { x: 1, y: 1 } } : { a: { x: number; y: number; }; }
>a : { x: number; y: number; }
>{ x: 1, y: 1 } : { x: number; y: number; }
@@ -70,25 +70,25 @@ var p5 = ([a = 1]) => { };
>1 : 1
var p6 = ({ a }) => { };
>p6 : ({a}: { a: any; }) => void
>({ a }) => { } : ({a}: { a: any; }) => void
>p6 : ({ a }: { a: any; }) => void
>({ a }) => { } : ({ a }: { a: any; }) => void
>a : any
var p7 = ({ a: { b } }) => { };
>p7 : ({a: {b}}: { a: { b: any; }; }) => void
>({ a: { b } }) => { } : ({a: {b}}: { a: { b: any; }; }) => void
>p7 : ({ a: { b } }: { a: { b: any; }; }) => void
>({ a: { b } }) => { } : ({ a: { b } }: { a: { b: any; }; }) => void
>a : any
>b : any
var p8 = ({ a = 1 }) => { };
>p8 : ({a}: { a?: number; }) => void
>({ a = 1 }) => { } : ({a}: { a?: number; }) => void
>p8 : ({ a }: { a?: number; }) => void
>({ a = 1 }) => { } : ({ a }: { a?: number; }) => void
>a : number
>1 : 1
var p9 = ({ a: { b = 1 } = { b: 1 } }) => { };
>p9 : ({a: {b}}: { a?: { b?: number; }; }) => void
>({ a: { b = 1 } = { b: 1 } }) => { } : ({a: {b}}: { a?: { b?: number; }; }) => void
>p9 : ({ a: { b } }: { a?: { b?: number; }; }) => void
>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b } }: { a?: { b?: number; }; }) => void
>a : any
>b : number
>1 : 1
@@ -97,8 +97,8 @@ var p9 = ({ a: { b = 1 } = { b: 1 } }) => { };
>1 : 1
var p10 = ([{ value, done }]) => { };
>p10 : ([{value, done}]: [{ value: any; done: any; }]) => void
>([{ value, done }]) => { } : ([{value, done}]: [{ value: any; done: any; }]) => void
>p10 : ([{ value, done }]: [{ value: any; done: any; }]) => void
>([{ value, done }]) => { } : ([{ value, done }]: [{ value: any; done: any; }]) => void
>value : any
>done : any
@@ -61,7 +61,7 @@
}
function f({} = a, [] = a, { p: {} = a} = a) {
>f : ({}?: any, []?: any, {p: {}}?: any) => ({}?: any, []?: any, {p: {}}?: any) => any
>f : ({}?: any, []?: any, { p: {} }?: any) => ({}?: any, []?: any, { p: {} }?: any) => any
>a : any
>a : any
>p : any
@@ -69,7 +69,7 @@
>a : any
return ({} = a, [] = a, { p: {} = a } = a) => a;
>({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, {p: {}}?: any) => any
>({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, { p: {} }?: any) => any
>a : any
>a : any
>p : any
@@ -61,7 +61,7 @@
}
function f({} = a, [] = a, { p: {} = a} = a) {
>f : ({}?: any, []?: any, {p: {}}?: any) => ({}?: any, []?: any, {p: {}}?: any) => any
>f : ({}?: any, []?: any, { p: {} }?: any) => ({}?: any, []?: any, { p: {} }?: any) => any
>a : any
>a : any
>p : any
@@ -69,7 +69,7 @@
>a : any
return ({} = a, [] = a, { p: {} = a } = a) => a;
>({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, {p: {}}?: any) => any
>({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, { p: {} }?: any) => any
>a : any
>a : any
>p : any
@@ -61,7 +61,7 @@
}
function f({} = a, [] = a, { p: {} = a} = a) {
>f : ({}?: any, []?: any, {p: {}}?: any) => ({}?: any, []?: any, {p: {}}?: any) => any
>f : ({}?: any, []?: any, { p: {} }?: any) => ({}?: any, []?: any, { p: {} }?: any) => any
>a : any
>a : any
>p : any
@@ -69,7 +69,7 @@
>a : any
return ({} = a, [] = a, { p: {} = a } = a) => a;
>({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, {p: {}}?: any) => any
>({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, { p: {} }?: any) => any
>a : any
>a : any
>p : any
@@ -9,7 +9,7 @@ declare function trans<T>(f: (x: T) => string): number;
trans(({a}) => a);
>trans(({a}) => a) : number
>trans : <T>(f: (x: T) => string) => number
>({a}) => a : ({a}: { a: any; }) => any
>({a}) => a : ({ a }: { a: any; }) => any
>a : any
>a : any
@@ -24,7 +24,7 @@ trans(([b,c]) => 'foo');
trans(({d: [e,f]}) => 'foo');
>trans(({d: [e,f]}) => 'foo') : number
>trans : <T>(f: (x: T) => string) => number
>({d: [e,f]}) => 'foo' : ({d: [e, f]}: { d: [any, any]; }) => string
>({d: [e,f]}) => 'foo' : ({ d: [e, f] }: { d: [any, any]; }) => string
>d : any
>e : any
>f : any
@@ -33,7 +33,7 @@ trans(({d: [e,f]}) => 'foo');
trans(([{g},{h}]) => 'foo');
>trans(([{g},{h}]) => 'foo') : number
>trans : <T>(f: (x: T) => string) => number
>([{g},{h}]) => 'foo' : ([{g}, {h}]: [{ g: any; }, { h: any; }]) => string
>([{g},{h}]) => 'foo' : ([{ g }, { h }]: [{ g: any; }, { h: any; }]) => string
>g : any
>h : any
>'foo' : "foo"
@@ -41,7 +41,7 @@ trans(([{g},{h}]) => 'foo');
trans(({a, b = 10}) => a);
>trans(({a, b = 10}) => a) : number
>trans : <T>(f: (x: T) => string) => number
>({a, b = 10}) => a : ({a, b}: { a: any; b?: number; }) => any
>({a, b = 10}) => a : ({ a, b }: { a: any; b?: number; }) => any
>a : any
>b : number
>10 : 10
@@ -10,7 +10,7 @@ export class Bar {
>Bar : Bar
private bar({ a, }: Arg): number {
>bar : ({a}: { a: number; }) => number
>bar : ({ a, }: { a: number; }) => number
>a : number
>Arg : { a: number; }
@@ -22,6 +22,6 @@ export declare class Bar2 {
>Bar2 : Bar2
private bar({ a, });
>bar : ({a}: { a: any; }) => any
>bar : ({ a, }: { a: any; }) => any
>a : any
}
+2 -2
View File
@@ -218,8 +218,8 @@ var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o;
>o : { a: number; b: string; }
var noContextualType = ({ aNumber = 12, ...notEmptyObject }) => aNumber + notEmptyObject.anythingGoes;
>noContextualType : ({aNumber, ...notEmptyObject}: { [x: string]: any; aNumber?: number; }) => any
>({ aNumber = 12, ...notEmptyObject }) => aNumber + notEmptyObject.anythingGoes : ({aNumber, ...notEmptyObject}: { [x: string]: any; aNumber?: number; }) => any
>noContextualType : ({ aNumber, ...notEmptyObject }: { [x: string]: any; aNumber?: number; }) => any
>({ aNumber = 12, ...notEmptyObject }) => aNumber + notEmptyObject.anythingGoes : ({ aNumber, ...notEmptyObject }: { [x: string]: any; aNumber?: number; }) => any
>aNumber : number
>12 : 12
>notEmptyObject : { [x: string]: any; }
@@ -1,6 +1,6 @@
=== tests/cases/conformance/types/rest/objectRestParameter.ts ===
function cloneAgain({ a, ...clone }: { a: number, b: string }): void {
>cloneAgain : ({a, ...clone}: { a: number; b: string; }) => void
>cloneAgain : ({ a, ...clone }: { a: number; b: string; }) => void
>a : number
>clone : { b: string; }
>a : number
@@ -19,7 +19,7 @@ declare function suddenly(f: (a: { x: { z, ka }, y: string }) => void);
suddenly(({ x: a, ...rest }) => rest.y);
>suddenly(({ x: a, ...rest }) => rest.y) : any
>suddenly : (f: (a: { x: { z: any; ka: any; }; y: string; }) => void) => any
>({ x: a, ...rest }) => rest.y : ({x: a, ...rest}: { x: { z: any; ka: any; }; y: string; }) => string
>({ x: a, ...rest }) => rest.y : ({ x: a, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
>x : any
>a : { z: any; ka: any; }
>rest : { y: string; }
@@ -30,7 +30,7 @@ suddenly(({ x: a, ...rest }) => rest.y);
suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka);
>suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka) : any
>suddenly : (f: (a: { x: { z: any; ka: any; }; y: string; }) => void) => any
>({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka : ({x: {z, ...nested}, ...rest}?: { x: { z: any; ka: any; }; y: string; }) => string
>({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka : ({ x: { z, ...nested }, ...rest }?: { x: { z: any; ka: any; }; y: string; }) => string
>x : any
>z : any
>12 : 12
@@ -57,7 +57,7 @@ class C {
>C : C
m({ a, ...clone }: { a: number, b: string}): void {
>m : ({a, ...clone}: { a: number; b: string; }) => void
>m : ({ a, ...clone }: { a: number; b: string; }) => void
>a : number
>clone : { b: string; }
>a : number
@@ -76,7 +76,7 @@ class C {
}
}
function foobar({ bar={}, ...opts }: any = {}) {
>foobar : ({bar, ...opts}?: any) => void
>foobar : ({ bar, ...opts }?: any) => void
>bar : {}
>{} : {}
>opts : any
@@ -84,18 +84,18 @@ function foobar({ bar={}, ...opts }: any = {}) {
}
foobar();
>foobar() : void
>foobar : ({bar, ...opts}?: any) => void
>foobar : ({ bar, ...opts }?: any) => void
foobar({ baz: 'hello' });
>foobar({ baz: 'hello' }) : void
>foobar : ({bar, ...opts}?: any) => void
>foobar : ({ bar, ...opts }?: any) => void
>{ baz: 'hello' } : { baz: string; }
>baz : string
>'hello' : "hello"
foobar({ bar: { greeting: 'hello' } });
>foobar({ bar: { greeting: 'hello' } }) : void
>foobar : ({bar, ...opts}?: any) => void
>foobar : ({ bar, ...opts }?: any) => void
>{ bar: { greeting: 'hello' } } : { bar: { greeting: string; }; }
>bar : { greeting: string; }
>{ greeting: 'hello' } : { greeting: string; }
@@ -1,6 +1,6 @@
=== tests/cases/conformance/types/rest/objectRestParameterES5.ts ===
function cloneAgain({ a, ...clone }: { a: number, b: string }): void {
>cloneAgain : ({a, ...clone}: { a: number; b: string; }) => void
>cloneAgain : ({ a, ...clone }: { a: number; b: string; }) => void
>a : number
>clone : { b: string; }
>a : number
@@ -19,7 +19,7 @@ declare function suddenly(f: (a: { x: { z, ka }, y: string }) => void);
suddenly(({ x: a, ...rest }) => rest.y);
>suddenly(({ x: a, ...rest }) => rest.y) : any
>suddenly : (f: (a: { x: { z: any; ka: any; }; y: string; }) => void) => any
>({ x: a, ...rest }) => rest.y : ({x: a, ...rest}: { x: { z: any; ka: any; }; y: string; }) => string
>({ x: a, ...rest }) => rest.y : ({ x: a, ...rest }: { x: { z: any; ka: any; }; y: string; }) => string
>x : any
>a : { z: any; ka: any; }
>rest : { y: string; }
@@ -30,7 +30,7 @@ suddenly(({ x: a, ...rest }) => rest.y);
suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka);
>suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka) : any
>suddenly : (f: (a: { x: { z: any; ka: any; }; y: string; }) => void) => any
>({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka : ({x: {z, ...nested}, ...rest}?: { x: { z: any; ka: any; }; y: string; }) => string
>({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' }) => rest.y + nested.ka : ({ x: { z, ...nested }, ...rest }?: { x: { z: any; ka: any; }; y: string; }) => string
>x : any
>z : any
>12 : 12
@@ -57,7 +57,7 @@ class C {
>C : C
m({ a, ...clone }: { a: number, b: string}): void {
>m : ({a, ...clone}: { a: number; b: string; }) => void
>m : ({ a, ...clone }: { a: number; b: string; }) => void
>a : number
>clone : { b: string; }
>a : number
@@ -76,7 +76,7 @@ class C {
}
}
function foobar({ bar={}, ...opts }: any = {}) {
>foobar : ({bar, ...opts}?: any) => void
>foobar : ({ bar, ...opts }?: any) => void
>bar : {}
>{} : {}
>opts : any
@@ -84,18 +84,18 @@ function foobar({ bar={}, ...opts }: any = {}) {
}
foobar();
>foobar() : void
>foobar : ({bar, ...opts}?: any) => void
>foobar : ({ bar, ...opts }?: any) => void
foobar({ baz: 'hello' });
>foobar({ baz: 'hello' }) : void
>foobar : ({bar, ...opts}?: any) => void
>foobar : ({ bar, ...opts }?: any) => void
>{ baz: 'hello' } : { baz: string; }
>baz : string
>'hello' : "hello"
foobar({ bar: { greeting: 'hello' } });
>foobar({ bar: { greeting: 'hello' } }) : void
>foobar : ({bar, ...opts}?: any) => void
>foobar : ({ bar, ...opts }?: any) => void
>{ bar: { greeting: 'hello' } } : { bar: { greeting: string; }; }
>bar : { greeting: string; }
>{ greeting: 'hello' } : { greeting: string; }
@@ -10,7 +10,7 @@ interface Foo {
}
function foobar({ bar = {}, ...opts }: Foo = {}) {
>foobar : ({bar, ...opts}?: Foo) => void
>foobar : ({ bar, ...opts }?: Foo) => void
>bar : any
>{} : {}
>opts : { baz?: any; }
@@ -37,7 +37,7 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no
>"none" : "none"
function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) {
>foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}: Robot) => void
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void
>skills : any
>primary : any
>primaryA : string
@@ -53,7 +53,7 @@ function foo1({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) {
>primaryA : string
}
function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) {
>foo2 : ({name: nameC, skills: {primary: primaryB, secondary: secondaryB}}: Robot) => void
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void
>name : any
>nameC : string
>skills : any
@@ -71,7 +71,7 @@ function foo2({ name: nameC, skills: { primary: primaryB, secondary: secondaryB
>secondaryB : string
}
function foo3({ skills }: Robot) {
>foo3 : ({skills}: Robot) => void
>foo3 : ({ skills }: Robot) => void
>skills : { primary: string; secondary: string; }
>Robot : Robot
@@ -87,12 +87,12 @@ function foo3({ skills }: Robot) {
foo1(robotA);
>foo1(robotA) : void
>foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}: Robot) => void
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void
>robotA : Robot
foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
>foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}: Robot) => void
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"Edger" : "Edger"
@@ -105,12 +105,12 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming"
foo2(robotA);
>foo2(robotA) : void
>foo2 : ({name: nameC, skills: {primary: primaryB, secondary: secondaryB}}: Robot) => void
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void
>robotA : Robot
foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
>foo2 : ({name: nameC, skills: {primary: primaryB, secondary: secondaryB}}: Robot) => void
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"Edger" : "Edger"
@@ -123,12 +123,12 @@ foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming"
foo3(robotA);
>foo3(robotA) : void
>foo3 : ({skills}: Robot) => void
>foo3 : ({ skills }: Robot) => void
>robotA : Robot
foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
>foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
>foo3 : ({skills}: Robot) => void
>foo3 : ({ skills }: Robot) => void
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"Edger" : "Edger"
@@ -37,7 +37,7 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no
>"none" : "none"
function foo1(
>foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}?: Robot) => void
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }?: Robot) => void
{
skills: {
>skills : any
@@ -71,7 +71,7 @@ function foo1(
>primaryA : string
}
function foo2(
>foo2 : ({name: nameC, skills: {primary: primaryB, secondary: secondaryB}}?: Robot) => void
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }?: Robot) => void
{
name: nameC = "name",
>name : any
@@ -110,7 +110,7 @@ function foo2(
>secondaryB : string
}
function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) {
>foo3 : ({skills}?: Robot) => void
>foo3 : ({ skills }?: Robot) => void
>skills : { primary?: string; secondary?: string; }
>{ primary: "SomeSkill", secondary: "someSkill" } : { primary: string; secondary: string; }
>primary : string
@@ -132,12 +132,12 @@ function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Ro
foo1(robotA);
>foo1(robotA) : void
>foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}?: Robot) => void
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }?: Robot) => void
>robotA : Robot
foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
>foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
>foo1 : ({skills: {primary: primaryA, secondary: secondaryA}}?: Robot) => void
>foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }?: Robot) => void
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"Edger" : "Edger"
@@ -150,12 +150,12 @@ foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming"
foo2(robotA);
>foo2(robotA) : void
>foo2 : ({name: nameC, skills: {primary: primaryB, secondary: secondaryB}}?: Robot) => void
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }?: Robot) => void
>robotA : Robot
foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
>foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
>foo2 : ({name: nameC, skills: {primary: primaryB, secondary: secondaryB}}?: Robot) => void
>foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }?: Robot) => void
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"Edger" : "Edger"
@@ -168,12 +168,12 @@ foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming"
foo3(robotA);
>foo3(robotA) : void
>foo3 : ({skills}?: Robot) => void
>foo3 : ({ skills }?: Robot) => void
>robotA : Robot
foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } });
>foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void
>foo3 : ({skills}?: Robot) => void
>foo3 : ({ skills }?: Robot) => void
>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; }
>name : string
>"Edger" : "Edger"
@@ -29,7 +29,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" };
>"mowing" : "mowing"
function foo1({ name: nameA }: Robot) {
>foo1 : ({name: nameA}: Robot) => void
>foo1 : ({ name: nameA }: Robot) => void
>name : any
>nameA : string
>Robot : Robot
@@ -42,7 +42,7 @@ function foo1({ name: nameA }: Robot) {
>nameA : string
}
function foo2({ name: nameB, skill: skillB }: Robot) {
>foo2 : ({name: nameB, skill: skillB}: Robot) => void
>foo2 : ({ name: nameB, skill: skillB }: Robot) => void
>name : any
>nameB : string
>skill : any
@@ -57,7 +57,7 @@ function foo2({ name: nameB, skill: skillB }: Robot) {
>nameB : string
}
function foo3({ name }: Robot) {
>foo3 : ({name}: Robot) => void
>foo3 : ({ name }: Robot) => void
>name : string
>Robot : Robot
@@ -71,12 +71,12 @@ function foo3({ name }: Robot) {
foo1(robotA);
>foo1(robotA) : void
>foo1 : ({name: nameA}: Robot) => void
>foo1 : ({ name: nameA }: Robot) => void
>robotA : Robot
foo1({ name: "Edger", skill: "cutting edges" });
>foo1({ name: "Edger", skill: "cutting edges" }) : void
>foo1 : ({name: nameA}: Robot) => void
>foo1 : ({ name: nameA }: Robot) => void
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
>name : string
>"Edger" : "Edger"
@@ -85,12 +85,12 @@ foo1({ name: "Edger", skill: "cutting edges" });
foo2(robotA);
>foo2(robotA) : void
>foo2 : ({name: nameB, skill: skillB}: Robot) => void
>foo2 : ({ name: nameB, skill: skillB }: Robot) => void
>robotA : Robot
foo2({ name: "Edger", skill: "cutting edges" });
>foo2({ name: "Edger", skill: "cutting edges" }) : void
>foo2 : ({name: nameB, skill: skillB}: Robot) => void
>foo2 : ({ name: nameB, skill: skillB }: Robot) => void
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
>name : string
>"Edger" : "Edger"
@@ -99,12 +99,12 @@ foo2({ name: "Edger", skill: "cutting edges" });
foo3(robotA);
>foo3(robotA) : void
>foo3 : ({name}: Robot) => void
>foo3 : ({ name }: Robot) => void
>robotA : Robot
foo3({ name: "Edger", skill: "cutting edges" });
>foo3({ name: "Edger", skill: "cutting edges" }) : void
>foo3 : ({name}: Robot) => void
>foo3 : ({ name }: Robot) => void
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
>name : string
>"Edger" : "Edger"
@@ -29,7 +29,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" };
>"mowing" : "mowing"
function foo1({ name: nameA = "<NoName>" }: Robot = { }) {
>foo1 : ({name: nameA}?: Robot) => void
>foo1 : ({ name: nameA }?: Robot) => void
>name : any
>nameA : string
>"<NoName>" : "<NoName>"
@@ -44,7 +44,7 @@ function foo1({ name: nameA = "<NoName>" }: Robot = { }) {
>nameA : string
}
function foo2({ name: nameB = "<NoName>", skill: skillB = "noSkill" }: Robot = {}) {
>foo2 : ({name: nameB, skill: skillB}?: Robot) => void
>foo2 : ({ name: nameB, skill: skillB }?: Robot) => void
>name : any
>nameB : string
>"<NoName>" : "<NoName>"
@@ -62,7 +62,7 @@ function foo2({ name: nameB = "<NoName>", skill: skillB = "noSkill" }: Robot = {
>nameB : string
}
function foo3({ name = "<NoName>" }: Robot = {}) {
>foo3 : ({name}?: Robot) => void
>foo3 : ({ name }?: Robot) => void
>name : string
>"<NoName>" : "<NoName>"
>Robot : Robot
@@ -78,12 +78,12 @@ function foo3({ name = "<NoName>" }: Robot = {}) {
foo1(robotA);
>foo1(robotA) : void
>foo1 : ({name: nameA}?: Robot) => void
>foo1 : ({ name: nameA }?: Robot) => void
>robotA : Robot
foo1({ name: "Edger", skill: "cutting edges" });
>foo1({ name: "Edger", skill: "cutting edges" }) : void
>foo1 : ({name: nameA}?: Robot) => void
>foo1 : ({ name: nameA }?: Robot) => void
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
>name : string
>"Edger" : "Edger"
@@ -92,12 +92,12 @@ foo1({ name: "Edger", skill: "cutting edges" });
foo2(robotA);
>foo2(robotA) : void
>foo2 : ({name: nameB, skill: skillB}?: Robot) => void
>foo2 : ({ name: nameB, skill: skillB }?: Robot) => void
>robotA : Robot
foo2({ name: "Edger", skill: "cutting edges" });
>foo2({ name: "Edger", skill: "cutting edges" }) : void
>foo2 : ({name: nameB, skill: skillB}?: Robot) => void
>foo2 : ({ name: nameB, skill: skillB }?: Robot) => void
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
>name : string
>"Edger" : "Edger"
@@ -106,12 +106,12 @@ foo2({ name: "Edger", skill: "cutting edges" });
foo3(robotA);
>foo3(robotA) : void
>foo3 : ({name}?: Robot) => void
>foo3 : ({ name }?: Robot) => void
>robotA : Robot
foo3({ name: "Edger", skill: "cutting edges" });
>foo3({ name: "Edger", skill: "cutting edges" }) : void
>foo3 : ({name}?: Robot) => void
>foo3 : ({ name }?: Robot) => void
>{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; }
>name : string
>"Edger" : "Edger"
@@ -28,7 +28,7 @@ export default function Component(props: ComponentProps) {
<ChildComponent {...props} />
><ChildComponent {...props} /> : JSX.Element
>ChildComponent : ({property1}: AnotherComponentProps) => JSX.Element
>ChildComponent : ({ property1 }: AnotherComponentProps) => JSX.Element
>props : ComponentProps
);
@@ -37,7 +37,7 @@ export default function Component(props: ComponentProps) {
return (<ChildComponent {...props} property1="NewString" />);
>(<ChildComponent {...props} property1="NewString" />) : JSX.Element
><ChildComponent {...props} property1="NewString" /> : JSX.Element
>ChildComponent : ({property1}: AnotherComponentProps) => JSX.Element
>ChildComponent : ({ property1 }: AnotherComponentProps) => JSX.Element
>props : ComponentProps
>property1 : string
}
@@ -51,7 +51,7 @@ interface AnotherComponentProps {
}
function ChildComponent({ property1 }: AnotherComponentProps) {
>ChildComponent : ({property1}: AnotherComponentProps) => JSX.Element
>ChildComponent : ({ property1 }: AnotherComponentProps) => JSX.Element
>property1 : string
>AnotherComponentProps : AnotherComponentProps
@@ -22,7 +22,7 @@ export default function Component(props: ComponentProps) {
<AnotherComponent {...props} property2 AnotherProperty1="hi"/>
><AnotherComponent {...props} property2 AnotherProperty1="hi"/> : JSX.Element
>AnotherComponent : ({property1}: AnotherComponentProps) => JSX.Element
>AnotherComponent : ({ property1 }: AnotherComponentProps) => JSX.Element
>props : ComponentProps
>property2 : true
>AnotherProperty1 : string
@@ -44,7 +44,7 @@ interface AnotherComponentProps {
}
function AnotherComponent({ property1 }: AnotherComponentProps) {
>AnotherComponent : ({property1}: AnotherComponentProps) => JSX.Element
>AnotherComponent : ({ property1 }: AnotherComponentProps) => JSX.Element
>property1 : string
>AnotherComponentProps : AnotherComponentProps
@@ -53,7 +53,7 @@ function Todo(prop: { key: number, todo: string }) {
>div : any
}
function TodoList({ todos }: TodoListProps) {
>TodoList : ({todos}: TodoListProps) => JSX.Element
>TodoList : ({ todos }: TodoListProps) => JSX.Element
>todos : TodoProp[]
>TodoListProps : TodoListProps
@@ -88,6 +88,6 @@ let x: TodoListProps;
<TodoList {...x}/>
><TodoList {...x}/> : JSX.Element
>TodoList : ({todos}: TodoListProps) => JSX.Element
>TodoList : ({ todos }: TodoListProps) => JSX.Element
>x : TodoListProps
@@ -79,21 +79,21 @@ const c5 = <OneThing yxx1='ok'>Hello</OneThing>
declare function TestingOneThing({y1: string}): JSX.Element;
>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>y1 : any
>string : any
>JSX : any
>Element : JSX.Element
declare function TestingOneThing(j: {"extra-data": string, yy?: string}): JSX.Element;
>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>j : { "extra-data": string; yy?: string; }
>yy : string
>JSX : any
>Element : JSX.Element
declare function TestingOneThing(n: {yy: number, direction?: number}): JSX.Element;
>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>n : { yy: number; direction?: number; }
>yy : number
>direction : number
@@ -101,7 +101,7 @@ declare function TestingOneThing(n: {yy: number, direction?: number}): JSX.Eleme
>Element : JSX.Element
declare function TestingOneThing(n: {yy: string, name: string}): JSX.Element;
>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>n : { yy: string; name: string; }
>yy : string
>name : string
@@ -112,27 +112,27 @@ declare function TestingOneThing(n: {yy: string, name: string}): JSX.Element;
const d1 = <TestingOneThing y1 extra-data />;
>d1 : JSX.Element
><TestingOneThing y1 extra-data /> : JSX.Element
>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>y1 : true
>extra-data : true
const d2 = <TestingOneThing extra-data="hello" />;
>d2 : JSX.Element
><TestingOneThing extra-data="hello" /> : JSX.Element
>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>extra-data : string
const d3 = <TestingOneThing extra-data="hello" yy="hihi" />;
>d3 : JSX.Element
><TestingOneThing extra-data="hello" yy="hihi" /> : JSX.Element
>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>extra-data : string
>yy : string
const d4 = <TestingOneThing extra-data="hello" yy={9} direction={10} />;
>d4 : JSX.Element
><TestingOneThing extra-data="hello" yy={9} direction={10} /> : JSX.Element
>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>extra-data : string
>yy : number
>9 : 9
@@ -142,7 +142,7 @@ const d4 = <TestingOneThing extra-data="hello" yy={9} direction={10} />;
const d5 = <TestingOneThing extra-data="hello" yy="hello" name="Bob" />;
>d5 : JSX.Element
><TestingOneThing extra-data="hello" yy="hello" name="Bob" /> : JSX.Element
>TestingOneThing : { ({y1: string}: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>TestingOneThing : { ({ y1: string }: { y1: any; }): JSX.Element; (j: { "extra-data": string; yy?: string; }): JSX.Element; (n: { yy: number; direction?: number; }): JSX.Element; (n: { yy: string; name: string; }): JSX.Element; }
>extra-data : string
>yy : string
>name : string
@@ -40,7 +40,7 @@ var App: React.StatelessComponent<{ children }> = ({children}) => (
>React : any
>StatelessComponent : React.StatelessComponent<P>
>children : any
>({children}) => ( <div > <MainMenu/> </div>) : ({children}: { children: any; } & { children?: React.ReactNode; }) => JSX.Element
>({children}) => ( <div > <MainMenu/> </div>) : ({ children }: { children: any; } & { children?: React.ReactNode; }) => JSX.Element
>children : any
>( <div > <MainMenu/> </div>) : JSX.Element