From a2d90d94d68e855cdc0a96a093a7aebdeccde8d3 Mon Sep 17 00:00:00 2001 From: u9g Date: Wed, 28 Jun 2023 02:47:22 -0400 Subject: [PATCH] Add comments to BindingPatternKind (#489) --- crates/oxc_ast/src/ast/js.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index bb5347385..e760b3e58 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -1236,9 +1236,16 @@ pub struct BindingPattern<'a> { #[derive(Debug, Hash)] #[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))] pub enum BindingPatternKind<'a> { + /// const a = 1 BindingIdentifier(Box<'a, BindingIdentifier>), + /// const {a} = 1 ObjectPattern(Box<'a, ObjectPattern<'a>>), + /// const [a] = 1 ArrayPattern(Box<'a, ArrayPattern<'a>>), + /// A defaulted binding pattern, ie: + /// const {a = 1} = 1 + /// the assignment pattern is a = 1 + /// it has an inner left that has a BindingIdentifier AssignmentPattern(Box<'a, AssignmentPattern<'a>>), }