diff --git a/crates/oxc_formatter/src/parentheses/expression.rs b/crates/oxc_formatter/src/parentheses/expression.rs index e6b558f0e0c17..138d34454f469 100644 --- a/crates/oxc_formatter/src/parentheses/expression.rs +++ b/crates/oxc_formatter/src/parentheses/expression.rs @@ -931,7 +931,8 @@ fn await_or_yield_needs_parens(span: Span, node: &AstNodes<'_>) -> bool { | AstNodes::TSSatisfiesExpression(_) | AstNodes::SpreadElement(_) | AstNodes::LogicalExpression(_) - | AstNodes::BinaryExpression(_), + | AstNodes::BinaryExpression(_) + | AstNodes::PrivateInExpression(_), ) { return true; } diff --git a/tasks/coverage/snapshots/formatter_test262.snap b/tasks/coverage/snapshots/formatter_test262.snap index f42db7356bf3b..234a33b56a5a2 100644 --- a/tasks/coverage/snapshots/formatter_test262.snap +++ b/tasks/coverage/snapshots/formatter_test262.snap @@ -2,12 +2,10 @@ commit: baa48a41 formatter_test262 Summary: AST Parsed : 44517/44517 (100.00%) -Positive Passed: 44513/44517 (99.99%) +Positive Passed: 44514/44517 (99.99%) Mismatch: tasks/coverage/test262/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR-LF.js Mismatch: tasks/coverage/test262/test/built-ins/Function/prototype/toString/line-terminator-normalisation-CR.js Mismatch: tasks/coverage/test262/test/built-ins/Function/prototype/toString/line-terminator-normalisation-LF.js -Expect to Parse: tasks/coverage/test262/test/language/expressions/in/private-field-rhs-yield-present.js -Cannot use `yield` as an identifier in a generator context