Merge pull request #14508 from Busyrev/fix-function-parameter-default-value
FIX: #14507 Function parameter default value wrongly emmited by Printer
This commit is contained in:
commit
4610dc7e3b
|
@ -819,8 +819,8 @@ namespace ts {
|
|||
writeIfPresent(node.dotDotDotToken, "...");
|
||||
emit(node.name);
|
||||
writeIfPresent(node.questionToken, "?");
|
||||
emitExpressionWithPrefix(" = ", node.initializer);
|
||||
emitWithPrefix(": ", node.type);
|
||||
emitExpressionWithPrefix(" = ", node.initializer);
|
||||
}
|
||||
|
||||
function emitDecorator(decorator: Decorator) {
|
||||
|
|
|
@ -45,6 +45,9 @@ namespace ts {
|
|||
|
||||
// comment9
|
||||
console.log(1 + 2);
|
||||
|
||||
// comment10
|
||||
function functionWithDefaultArgValue(argument: string = "defaultValue"): void { }
|
||||
`, ScriptTarget.ES2015);
|
||||
|
||||
printsCorrectly("default", {}, printer => printer.printFile(sourceFile));
|
||||
|
|
|
@ -23,3 +23,5 @@ const enum E2 {
|
|||
}
|
||||
// comment9
|
||||
console.log(1 + 2);
|
||||
// comment10
|
||||
function functionWithDefaultArgValue(argument: string = "defaultValue"): void { }
|
||||
|
|
|
@ -15,3 +15,4 @@ const enum E2 {
|
|||
second
|
||||
}
|
||||
console.log(1 + 2);
|
||||
function functionWithDefaultArgValue(argument: string = "defaultValue"): void { }
|
||||
|
|
Loading…
Reference in a new issue