From 1005c0aecae322e02d5c7c4994bcb2d2b613a2ad Mon Sep 17 00:00:00 2001 From: camc314 <18101008+camc314@users.noreply.github.com> Date: Tue, 23 Dec 2025 12:32:11 +0000 Subject: [PATCH] docs(ast): fix docs for AssignmentPattern in BindingPattern enum (#17309) follow on from #15925 --- crates/oxc_ast/src/ast/js.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index cb2cc513fba9e..878c67888c943 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -1583,16 +1583,15 @@ pub enum BindingPattern<'a> { /// Also e.g. `x = 1` in: /// - `const [x = 1] = arr;` /// - `const { a: x = 1 } = obj;` - /// - `function f(x = 1) {}` /// /// Also e.g. `{x} = obj` in: /// - `const [{x} = obj] = arr;` /// - `const { a: {x} = obj2 } = obj;` - /// - `function f({x} = obj) {}` /// /// Invalid in: - /// - `BindingRestElement` e.g. `const [...x = 1] = arr;`. - /// - `CatchParameter` e.g. `try {} catch (e = 1) {}`. + /// - [`FormalParameter`] - uses [`FormalParameter::initializer`] instead. + /// - [`CatchParameter`] - e.g. `try {} catch (e = 1) {}` is a syntax error. + /// - [`BindingRestElement`] - e.g. `const [...x = 1] = arr;` is a syntax error. AssignmentPattern(Box<'a, AssignmentPattern<'a>>) = 3, }