Use charCodes at more places in the parser (#8176)

This commit is contained in:
Ger Hobbelt
2018-06-15 13:21:32 +02:00
committed by Mateusz Burzyński
parent ba98cf782a
commit 07c88e6f0b
2 changed files with 18 additions and 13 deletions

View File

@@ -1811,7 +1811,10 @@ export default (superClass: Class<Parser>): Class<Parser> =>
// ensure that inside flow types, we bypass the jsx parser plugin
readToken(code: number): void {
const next = this.input.charCodeAt(this.state.pos + 1);
if (this.state.inType && (code === 62 || code === 60)) {
if (
this.state.inType &&
(code === charCodes.greaterThan || code === charCodes.lessThan)
) {
return this.finishOp(tt.relational, 1);
} else if (isIteratorStart(code, next)) {
this.state.isIterator = true;