diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index 4fdfd9e8a5699..4a5b775265393 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -2196,7 +2196,7 @@ pub struct ImportExpression<'a> { pub struct ImportDeclaration<'a> { pub span: Span, /// `None` for `import 'foo'`, `Some([])` for `import {} from 'foo'` - #[estree(with = "OptionVecDefault", type = "Array")] + #[estree(via = "OptionVecDefault", type = "Array")] pub specifiers: Option>>, pub source: StringLiteral<'a>, pub phase: Option, diff --git a/tasks/ast_tools/src/derives/estree.rs b/tasks/ast_tools/src/derives/estree.rs index 36079bbb9282b..097cb494f651f 100644 --- a/tasks/ast_tools/src/derives/estree.rs +++ b/tasks/ast_tools/src/derives/estree.rs @@ -142,7 +142,7 @@ fn serialize_struct(def: &StructDef, schema: &Schema) -> TokenStream { } )?; }); - } else if let Some(with) = &field.markers.derive_attributes.estree.with { + } else if let Some(with) = &field.markers.derive_attributes.estree.via { let with_ident = with.to_ident(); fields.push(quote! { map.serialize_entry( diff --git a/tasks/ast_tools/src/markers.rs b/tasks/ast_tools/src/markers.rs index aa1deaaf181ac..b47d3513a2af3 100644 --- a/tasks/ast_tools/src/markers.rs +++ b/tasks/ast_tools/src/markers.rs @@ -227,7 +227,7 @@ pub struct ESTreeFieldAttribute { pub rename: Option, pub typescript_type: Option, pub append_to: Option, - pub with: Option, + pub via: Option, } impl Parse for ESTreeFieldAttribute { @@ -237,7 +237,7 @@ impl Parse for ESTreeFieldAttribute { let mut rename = None; let mut typescript_type = None; let mut append_to = None; - let mut with = None; + let mut via = None; loop { let is_type = input.peek(Token![type]); @@ -283,10 +283,10 @@ impl Parse for ESTreeFieldAttribute { "Duplicate estree(append_to)" ); } - "with" => { + "via" => { input.parse::()?; assert!( - with.replace(input.parse::()?.value()).is_none(), + via.replace(input.parse::()?.value()).is_none(), "Duplicate estree(with)" ); } @@ -299,7 +299,7 @@ impl Parse for ESTreeFieldAttribute { break; } } - Ok(Self { flatten, skip, rename, typescript_type, append_to, with }) + Ok(Self { flatten, skip, rename, typescript_type, append_to, via }) } }