We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd99589 commit 858cca5Copy full SHA for 858cca5
src/parser.ts
@@ -1437,9 +1437,14 @@ export class Parser extends DiagnosticEmitter {
1437
tn.range(signatureStart, tn.pos)
1438
);
1439
1440
- var body: Statement | null;
+ var body: Statement | null = null;
1441
if (arrowKind) {
1442
- body = this.parseStatement(tn, false);
+ if (tn.skip(Token.OPENBRACE)) {
1443
+ body = this.parseBlockStatement(tn, false);
1444
+ } else {
1445
+ let bodyExpression = this.parseExpression(tn, Precedence.COMMA + 1);
1446
+ if (bodyExpression) body = Node.createExpressionStatement(bodyExpression);
1447
+ }
1448
} else {
1449
if (!tn.skip(Token.OPENBRACE)) {
1450
this.error(
0 commit comments