diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b855103d9bf..7e692dc78b8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2192,16 +2192,16 @@ namespace ts { } function buildBindingPatternDisplay(bindingPattern: BindingPattern, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, symbolStack?: Symbol[]) { - // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. + // We have to explicitly emit square bracket and bracket because these tokens are not stored inside the node. if (bindingPattern.kind === SyntaxKind.ObjectBindingPattern) { writePunctuation(writer, SyntaxKind.OpenBraceToken); - buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, enclosingDeclaration, flags, symbolStack, buildBindingElementDisplay); + buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, e => buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack)); writePunctuation(writer, SyntaxKind.CloseBraceToken); } else if (bindingPattern.kind === SyntaxKind.ArrayBindingPattern) { writePunctuation(writer, SyntaxKind.OpenBracketToken); const elements = bindingPattern.elements; - buildDisplayForCommaSeparatedList(elements, writer, enclosingDeclaration, flags, symbolStack, buildBindingElementDisplay); + buildDisplayForCommaSeparatedList(elements, writer, e => buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack)); if (elements && elements.hasTrailingComma) { writePunctuation(writer, SyntaxKind.CommaToken); } @@ -2217,35 +2217,34 @@ namespace ts { if (bindingElement.propertyName) { writer.writeSymbol(getTextOfNode(bindingElement.propertyName), bindingElement.symbol); writePunctuation(writer, SyntaxKind.ColonToken); + writeSpace(writer); } - if (bindingElement.name) { - if (isBindingPattern(bindingElement.name)) { - buildBindingPatternDisplay(bindingElement.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - if (bindingElement.dotDotDotToken) { - writePunctuation(writer, SyntaxKind.DotDotDotToken); - } - appendSymbolNameOnly(bindingElement.symbol, writer); + if (isBindingPattern(bindingElement.name)) { + buildBindingPatternDisplay(bindingElement.name, writer, enclosingDeclaration, flags, symbolStack); + } + else { + if (bindingElement.dotDotDotToken) { + writePunctuation(writer, SyntaxKind.DotDotDotToken); } + appendSymbolNameOnly(bindingElement.symbol, writer); } } function buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, symbolStack?: Symbol[]) { if (typeParameters && typeParameters.length) { writePunctuation(writer, SyntaxKind.LessThanToken); - buildDisplayForCommaSeparatedList(typeParameters, writer, enclosingDeclaration, flags, symbolStack, buildTypeParameterDisplay); + buildDisplayForCommaSeparatedList(typeParameters, writer, p => buildTypeParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack)); writePunctuation(writer, SyntaxKind.GreaterThanToken); } } - function buildDisplayForCommaSeparatedList(list: T[], writer: SymbolWriter, enclosingDeclaration: Node, flags: TypeFormatFlags, symbolStack: Symbol[], action: (item: T, writer: SymbolWriter, enclosingDeclaration: Node, flags: TypeFormatFlags, symbolStack: Symbol[]) => void) { + function buildDisplayForCommaSeparatedList(list: T[], writer: SymbolWriter, action: (item: T) => void) { for (let i = 0; i < list.length; i++) { if (i > 0) { writePunctuation(writer, SyntaxKind.CommaToken); writeSpace(writer); } - action(list[i], writer, enclosingDeclaration, flags, symbolStack); + action(list[i]); } } diff --git a/tests/baselines/reference/arrowFunctionExpressions.types b/tests/baselines/reference/arrowFunctionExpressions.types index 9efc2db7a3b..41344c61cc4 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.types +++ b/tests/baselines/reference/arrowFunctionExpressions.types @@ -88,8 +88,8 @@ var p6 = ({ a }) => { }; >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 @@ -100,8 +100,8 @@ var p8 = ({ a = 1 }) => { }; >1 : number 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 : number diff --git a/tests/baselines/reference/declarationEmitDestructuring1.types b/tests/baselines/reference/declarationEmitDestructuring1.types index a1c7acad853..abba67981d8 100644 --- a/tests/baselines/reference/declarationEmitDestructuring1.types +++ b/tests/baselines/reference/declarationEmitDestructuring1.types @@ -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 diff --git a/tests/baselines/reference/declarationEmit_bindingPatters.js b/tests/baselines/reference/declarationEmit_bindingPatterns.js similarity index 70% rename from tests/baselines/reference/declarationEmit_bindingPatters.js rename to tests/baselines/reference/declarationEmit_bindingPatterns.js index e97d93dc634..c2063ead215 100644 --- a/tests/baselines/reference/declarationEmit_bindingPatters.js +++ b/tests/baselines/reference/declarationEmit_bindingPatterns.js @@ -1,4 +1,4 @@ -//// [declarationEmit_bindingPatters.ts] +//// [declarationEmit_bindingPatterns.ts] const k = ({x: z = 'y'}) => { } @@ -6,7 +6,7 @@ var a; function f({} = a, [] = a, { p: {} = a} = a) { } -//// [declarationEmit_bindingPatters.js] +//// [declarationEmit_bindingPatterns.js] var k = function (_a) { var _b = _a.x, z = _b === void 0 ? 'y' : _b; }; @@ -18,8 +18,8 @@ function f(_a, _b, _c) { } -//// [declarationEmit_bindingPatters.d.ts] -declare const k: ({x:z}: { +//// [declarationEmit_bindingPatterns.d.ts] +declare const k: ({x: z}: { x?: string; }) => void; declare var a: any; diff --git a/tests/baselines/reference/declarationEmit_bindingPatterns.symbols b/tests/baselines/reference/declarationEmit_bindingPatterns.symbols new file mode 100644 index 00000000000..b39aca17ea3 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_bindingPatterns.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/declarationEmit_bindingPatterns.ts === + +const k = ({x: z = 'y'}) => { } +>k : Symbol(k, Decl(declarationEmit_bindingPatterns.ts, 1, 5)) +>x : Symbol(x) +>z : Symbol(z, Decl(declarationEmit_bindingPatterns.ts, 1, 12)) + +var a; +>a : Symbol(a, Decl(declarationEmit_bindingPatterns.ts, 3, 3)) + +function f({} = a, [] = a, { p: {} = a} = a) { +>f : Symbol(f, Decl(declarationEmit_bindingPatterns.ts, 3, 6)) +>a : Symbol(a, Decl(declarationEmit_bindingPatterns.ts, 3, 3)) +>a : Symbol(a, Decl(declarationEmit_bindingPatterns.ts, 3, 3)) +>a : Symbol(a, Decl(declarationEmit_bindingPatterns.ts, 3, 3)) +>a : Symbol(a, Decl(declarationEmit_bindingPatterns.ts, 3, 3)) +} diff --git a/tests/baselines/reference/declarationEmit_bindingPatterns.types b/tests/baselines/reference/declarationEmit_bindingPatterns.types new file mode 100644 index 00000000000..eff2d4bd4a3 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_bindingPatterns.types @@ -0,0 +1,20 @@ +=== tests/cases/compiler/declarationEmit_bindingPatterns.ts === + +const k = ({x: z = 'y'}) => { } +>k : ({x: z}: { x?: string; }) => void +>({x: z = 'y'}) => { } : ({x: z}: { x?: string; }) => void +>x : any +>z : string +>'y' : string + +var a; +>a : any + +function f({} = a, [] = a, { p: {} = a} = a) { +>f : ({}?: any, []?: any, {p: {}}?: any) => void +>a : any +>a : any +>p : any +>a : any +>a : any +} diff --git a/tests/baselines/reference/declarationEmit_bindingPatters.symbols b/tests/baselines/reference/declarationEmit_bindingPatters.symbols deleted file mode 100644 index 522166ed511..00000000000 --- a/tests/baselines/reference/declarationEmit_bindingPatters.symbols +++ /dev/null @@ -1,17 +0,0 @@ -=== tests/cases/compiler/declarationEmit_bindingPatters.ts === - -const k = ({x: z = 'y'}) => { } ->k : Symbol(k, Decl(declarationEmit_bindingPatters.ts, 1, 5)) ->x : Symbol(x) ->z : Symbol(z, Decl(declarationEmit_bindingPatters.ts, 1, 12)) - -var a; ->a : Symbol(a, Decl(declarationEmit_bindingPatters.ts, 3, 3)) - -function f({} = a, [] = a, { p: {} = a} = a) { ->f : Symbol(f, Decl(declarationEmit_bindingPatters.ts, 3, 6)) ->a : Symbol(a, Decl(declarationEmit_bindingPatters.ts, 3, 3)) ->a : Symbol(a, Decl(declarationEmit_bindingPatters.ts, 3, 3)) ->a : Symbol(a, Decl(declarationEmit_bindingPatters.ts, 3, 3)) ->a : Symbol(a, Decl(declarationEmit_bindingPatters.ts, 3, 3)) -} diff --git a/tests/baselines/reference/declarationEmit_bindingPatters.types b/tests/baselines/reference/declarationEmit_bindingPatters.types deleted file mode 100644 index 44c5b3e9f43..00000000000 --- a/tests/baselines/reference/declarationEmit_bindingPatters.types +++ /dev/null @@ -1,20 +0,0 @@ -=== tests/cases/compiler/declarationEmit_bindingPatters.ts === - -const k = ({x: z = 'y'}) => { } ->k : ({x:z}: { x?: string; }) => void ->({x: z = 'y'}) => { } : ({x:z}: { x?: string; }) => void ->x : any ->z : string ->'y' : string - -var a; ->a : any - -function f({} = a, [] = a, { p: {} = a} = a) { ->f : ({}?: any, []?: any, {p:{}}?: any) => void ->a : any ->a : any ->p : any ->a : any ->a : any -} diff --git a/tests/baselines/reference/destructuringInFunctionType.types b/tests/baselines/reference/destructuringInFunctionType.types index 93e702225b5..0cf057e06a3 100644 --- a/tests/baselines/reference/destructuringInFunctionType.types +++ b/tests/baselines/reference/destructuringInFunctionType.types @@ -40,7 +40,7 @@ type T3 = ([{ a: b }, { b: a }]); >a : a type F3 = ([{ a: b }, { b: a }]) => void; ->F3 : ([{a:b}, {b:a}]: [{ a: any; }, { b: any; }]) => void +>F3 : ([{a: b}, {b: a}]: [{ a: any; }, { b: any; }]) => void >a : any >b : any >b : any @@ -53,13 +53,13 @@ type T4 = ([{ a: [b, c] }]); >c : c type F4 = ([{ a: [b, c] }]) => void; ->F4 : ([{a:[b, c]}]: [{ a: [any, any]; }]) => void +>F4 : ([{a: [b, c]}]: [{ a: [any, any]; }]) => void >a : any >b : any >c : any type C1 = new ([{ a: [b, c] }]) => void; ->C1 : new ([{a:[b, c]}]: [{ a: [any, any]; }]) => void +>C1 : new ([{a: [b, c]}]: [{ a: [any, any]; }]) => void >a : any >b : any >c : any diff --git a/tests/baselines/reference/destructuringWithLiteralInitializers.types b/tests/baselines/reference/destructuringWithLiteralInitializers.types index 97e9b8d095a..9b970679f74 100644 --- a/tests/baselines/reference/destructuringWithLiteralInitializers.types +++ b/tests/baselines/reference/destructuringWithLiteralInitializers.types @@ -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 : number @@ -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; } diff --git a/tests/baselines/reference/emitArrowFunctionES6.types b/tests/baselines/reference/emitArrowFunctionES6.types index 1730ef25534..d37c08f855c 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.types +++ b/tests/baselines/reference/emitArrowFunctionES6.types @@ -75,8 +75,8 @@ var p6 = ({ a }) => { }; >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 @@ -87,8 +87,8 @@ var p8 = ({ a = 1 }) => { }; >1 : number 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 : number diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types index a9a9366ae22..3640d468a59 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5.types @@ -62,7 +62,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 @@ -70,7 +70,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 diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types index 09e1f0b853b..20b7d5ec2b6 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES6.types @@ -62,7 +62,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 @@ -70,7 +70,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 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types index 323612ffc94..af27c32d15b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types @@ -37,7 +37,7 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >"none" : string 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 @@ -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" : string @@ -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" : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types index 5d8cbc311ae..1115931feef 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types @@ -37,7 +37,7 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no >"none" : string 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 @@ -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" : string @@ -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" : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types index 9154ba582d8..6b8f26acf43 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types @@ -29,7 +29,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" }; >"mowing" : string 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 @@ -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" : string @@ -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" : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types index ed7090d4fc8..253c5feae8f 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types @@ -29,7 +29,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" }; >"mowing" : string function foo1({ name: nameA = "" }: Robot = { }) { ->foo1 : ({name:nameA}?: Robot) => void +>foo1 : ({name: nameA}?: Robot) => void >name : any >nameA : string >"" : string @@ -44,7 +44,7 @@ function foo1({ name: nameA = "" }: Robot = { }) { >nameA : string } function foo2({ name: nameB = "", skill: skillB = "noSkill" }: Robot = {}) { ->foo2 : ({name:nameB, skill:skillB}?: Robot) => void +>foo2 : ({name: nameB, skill: skillB}?: Robot) => void >name : any >nameB : string >"" : string @@ -78,12 +78,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" : string @@ -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" : string diff --git a/tests/cases/compiler/declarationEmit_bindingPatters.ts b/tests/cases/compiler/declarationEmit_bindingPatterns.ts similarity index 100% rename from tests/cases/compiler/declarationEmit_bindingPatters.ts rename to tests/cases/compiler/declarationEmit_bindingPatterns.ts