Skip to content

Commit

Permalink
Add: better parser error when using jsx
Browse files Browse the repository at this point in the history
Address babel#11499
  • Loading branch information
penguingovernor committed Jun 16, 2020
1 parent a74a52f commit 36c699e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/babel-parser/src/parser/expression.js
Expand Up @@ -1170,6 +1170,12 @@ export default class ExpressionParser extends LValParser {
}
}
// fall through
case tt.relational: {
if (this.state.value === "<") {
throw this.expectOnePlugin(["jsx", "flow", "typescript"]);
}
}
// fall through
default:
throw this.unexpected();
}
Expand Down

0 comments on commit 36c699e

Please sign in to comment.