mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 20:51:43 -06:00
Code review comments
This commit is contained in:
parent
7680cdfaee
commit
c3cfebfda8
@ -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(<BindingPattern>bindingElement.name, writer, enclosingDeclaration, flags, symbolStack);
|
||||
}
|
||||
else {
|
||||
if (bindingElement.dotDotDotToken) {
|
||||
writePunctuation(writer, SyntaxKind.DotDotDotToken);
|
||||
}
|
||||
appendSymbolNameOnly(bindingElement.symbol, writer);
|
||||
if (isBindingPattern(bindingElement.name)) {
|
||||
buildBindingPatternDisplay(<BindingPattern>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<T>(list: T[], writer: SymbolWriter, enclosingDeclaration: Node, flags: TypeFormatFlags, symbolStack: Symbol[], action: (item: T, writer: SymbolWriter, enclosingDeclaration: Node, flags: TypeFormatFlags, symbolStack: Symbol[]) => void) {
|
||||
function buildDisplayForCommaSeparatedList<T>(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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
@ -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))
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
@ -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))
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
@ -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
|
||||
|
||||
@ -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; }
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -29,7 +29,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" };
|
||||
>"mowing" : string
|
||||
|
||||
function foo1({ name: nameA = "<NoName>" }: Robot = { }) {
|
||||
>foo1 : ({name:nameA}?: Robot) => void
|
||||
>foo1 : ({name: nameA}?: Robot) => void
|
||||
>name : any
|
||||
>nameA : string
|
||||
>"<NoName>" : string
|
||||
@ -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>" : string
|
||||
@ -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" : 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user