Skip to content

Commit e0c35f2

Browse files
Restore arrow function.
1 parent 1fbdb86 commit e0c35f2

File tree

1 file changed

+2
-6
lines changed
  • src/compiler/transformers

1 file changed

+2
-6
lines changed

src/compiler/transformers/es6.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ namespace ts {
224224
: visitorWorker(node);
225225
}
226226

227-
function saveStateAndInvoke<T>(node: Node, f: (node: Node) => T): T {
227+
function saveStateAndInvoke<T extends Node, U>(node: T, f: (node: T) => U): U {
228228
const savedEnclosingFunction = enclosingFunction;
229229
const savedEnclosingNonArrowFunction = enclosingNonArrowFunction;
230230
const savedEnclosingNonAsyncFunctionBody = enclosingNonAsyncFunctionBody;
@@ -867,7 +867,7 @@ namespace ts {
867867
}
868868

869869
if (constructor) {
870-
const body = saveStateAndInvoke(constructor, makeTransformerForConstructorBodyAtOffset(statementOffset));
870+
const body = saveStateAndInvoke(constructor, constructor => visitNodes(constructor.body.statements, visitor, isStatement, /*start*/ statementOffset));
871871
addRange(statements, body);
872872
}
873873

@@ -900,10 +900,6 @@ namespace ts {
900900
return block;
901901
}
902902

903-
function makeTransformerForConstructorBodyAtOffset(offset: number): (c: ConstructorDeclaration) => NodeArray<Statement> {
904-
return constructor => visitNodes(constructor.body.statements, visitor, isStatement, /*start*/ offset);
905-
}
906-
907903
/**
908904
* We want to try to avoid emitting a return statement in certain cases if a user already returned something.
909905
* It would be pointless and generate dead code, so we'll try to make things a little bit prettier

0 commit comments

Comments
 (0)