perf: call isLineTerminator as last check
This commit is contained in:
parent
3a3d5cbe9c
commit
f216975378
@ -1281,7 +1281,7 @@ export default class StatementParser extends ExpressionParser {
|
|||||||
} else if (
|
} else if (
|
||||||
isSimple &&
|
isSimple &&
|
||||||
(key.name === "get" || key.name === "set") &&
|
(key.name === "get" || key.name === "set") &&
|
||||||
!(this.isLineTerminator() && this.match(tt.star))
|
!(this.match(tt.star) && this.isLineTerminator())
|
||||||
) {
|
) {
|
||||||
// `get\n*` is an uninitialized property named 'get' followed by a generator.
|
// `get\n*` is an uninitialized property named 'get' followed by a generator.
|
||||||
// a getter or setter
|
// a getter or setter
|
||||||
|
|||||||
@ -1319,7 +1319,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
tsCheckLineTerminatorAndMatch(tokenType: TokenType, next: boolean) {
|
tsCheckLineTerminatorAndMatch(tokenType: TokenType, next: boolean) {
|
||||||
return !this.isLineTerminator() && (next || this.match(tokenType));
|
return (next || this.match(tokenType)) && !this.isLineTerminator();
|
||||||
}
|
}
|
||||||
|
|
||||||
tsTryParseGenericAsyncArrowFunction(
|
tsTryParseGenericAsyncArrowFunction(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user