Skip to content

Commit dff9849

Browse files
committed
Make multiLine optional in convertToFunctionBody
1 parent ddcd22e commit dff9849

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/compiler/factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,11 +2343,11 @@ namespace ts {
23432343
return qualifiedName;
23442344
}
23452345

2346-
export function convertToFunctionBody(node: ConciseBody) {
2346+
export function convertToFunctionBody(node: ConciseBody, multiLine?: boolean) {
23472347
if (isBlock(node)) {
23482348
return node;
23492349
}
2350-
return createBlock([createReturn(node, node)], node, /*multiLine*/ true);
2350+
return createBlock([createReturn(node, node)], node, multiLine);
23512351
}
23522352

23532353
function isUseStrictPrologue(node: ExpressionStatement): boolean {

src/compiler/transformers/esnext.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,12 @@ namespace ts {
363363
}
364364
}
365365
}
366-
367366
const body = visitNode(node.body, visitor, isConciseBody);
368367
const trailingStatements = endLexicalEnvironment();
369368
if (some(leadingStatements) || some(trailingStatements)) {
370-
const block = convertToFunctionBody(body);
369+
const block = convertToFunctionBody(body, /*multiLine*/ true);
371370
return updateBlock(block, createNodeArray(concatenate(concatenate(leadingStatements, block.statements), trailingStatements), block.statements));
372371
}
373-
374372
return body;
375373
}
376374
}

0 commit comments

Comments
 (0)