From e65c78c910c9d80955d62ac28605668543f2b040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sun, 29 Dec 2019 16:13:54 -0500 Subject: [PATCH] refactor: remove unreachable code --- packages/babel-parser/src/parser/expression.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 1ef6fcf82f96..723762191b33 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -904,6 +904,8 @@ export default class ExpressionParser extends LValParser { return this.finishNode(node, "Super"); case tt._import: + // this.state.type can only be tt.dot or tt.parenL + // otherwise it would be parsed in parseStatementContent node = this.startNode(); this.next(); @@ -913,9 +915,6 @@ export default class ExpressionParser extends LValParser { this.expectPlugin("dynamicImport", node.start); - if (!this.match(tt.parenL)) { - this.unexpected(null, tt.parenL); - } return this.finishNode(node, "Import"); case tt._this: node = this.startNode();