diff --git a/packages/babylon/src/parser/statement.js b/packages/babylon/src/parser/statement.js index f58e661e83..a0050cc2d0 100644 --- a/packages/babylon/src/parser/statement.js +++ b/packages/babylon/src/parser/statement.js @@ -460,7 +460,8 @@ pp.parseBlockBody = function (node, allowDirectives, topLevel, end) { let stmt = this.parseStatement(true, topLevel); if (allowDirectives && !parsedNonDirective && - stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral") { + stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && + !stmt.expression.extra.parenthesized) { let directive = this.stmtToDirective(stmt); node.directives.push(directive);