mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
fix(ast): properly serialize FormalParameter (#411)
This commit is contained in:
parent
7c79fbc026
commit
86efc07188
2 changed files with 5 additions and 8 deletions
|
|
@ -1175,9 +1175,8 @@ pub struct DebuggerStatement {
|
|||
|
||||
/// Destructuring Binding Patterns
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
|
||||
pub struct BindingPattern<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub kind: BindingPatternKind<'a>,
|
||||
pub type_annotation: Option<Box<'a, TSTypeAnnotation<'a>>>,
|
||||
pub optional: bool,
|
||||
|
|
@ -1309,11 +1308,10 @@ pub struct FormalParameters<'a> {
|
|||
}
|
||||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
pub struct FormalParameter<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub pattern: BindingPattern<'a>,
|
||||
pub accessibility: Option<TSAccessibility>,
|
||||
pub readonly: bool,
|
||||
|
|
@ -1321,7 +1319,7 @@ pub struct FormalParameter<'a> {
|
|||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
pub enum FormalParameterKind {
|
||||
/// <https://tc39.es/ecma262/#prod-FormalParameters>
|
||||
FormalParameter,
|
||||
|
|
|
|||
|
|
@ -1382,17 +1382,16 @@ pub struct FormalParameters<'a> {
|
|||
}
|
||||
|
||||
#[derive(Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
|
||||
pub struct FormalParameter<'a> {
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub span: Span,
|
||||
#[cfg_attr(feature = "serde", serde(flatten))]
|
||||
pub pattern: BindingPattern<'a>,
|
||||
pub decorators: Vec<'a, Decorator<'a>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize))]
|
||||
pub enum FormalParameterKind {
|
||||
/// <https://tc39.es/ecma262/#prod-FormalParameters>
|
||||
FormalParameter,
|
||||
|
|
|
|||
Loading…
Reference in a new issue