Remove unused code in the TS parser plugin (#10025)

This commit is contained in:
Nicolò Ribaudo 2019-05-25 08:46:01 +02:00 committed by GitHub
parent b6486a22cb
commit 888b9f6940
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,17 +161,6 @@ export default (superClass: Class<Parser>): Class<Parser> =>
);
}
tsTryParseDelimitedList<T: N.Node>(
kind: ParsingContext,
parseElement: () => ?T,
): ?(T[]) {
return this.tsParseDelimitedListWorker(
kind,
parseElement,
/* expectSuccess */ false,
);
}
/**
* If !expectSuccess, returns undefined instead of failing to parse.
* If expectSuccess, parseElement should always return a defined value.
@ -1270,23 +1259,6 @@ export default (superClass: Class<Parser>): Class<Parser> =>
}
}
nodeWithSamePosition<T: N.Node>(original: N.Node, type: string): T {
const node = this.startNodeAtNode(original);
node.type = type;
node.end = original.end;
node.loc.end = original.loc.end;
if (original.leadingComments) {
node.leadingComments = original.leadingComments;
}
if (original.trailingComments) {
node.trailingComments = original.trailingComments;
}
if (original.innerComments) node.innerComments = original.innerComments;
return node;
}
tsTryParseDeclare(nany: any): ?N.Declaration {
if (this.isLineTerminator()) {
return;