Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use super::{macros::inherit_variants, *};
)]
#[derive(Debug)]
#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
#[estree(field_order(span, directives, source_type, hashbang), via = ProgramConverter)]
#[estree(field_order(span, body, source_type, hashbang), via = ProgramConverter)]
pub struct Program<'a> {
pub span: Span,
pub source_type: SourceType,
Expand All @@ -40,9 +40,8 @@ pub struct Program<'a> {
#[estree(skip)]
pub comments: Vec<'a, Comment>,
pub hashbang: Option<Hashbang<'a>>,
#[estree(rename = "body")]
#[estree(prepend_to = "body")]
pub directives: Vec<'a, Directive<'a>>,
#[estree(append_to = "directives")]
pub body: Vec<'a, Statement<'a>>,
pub scope_id: Cell<Option<ScopeId>>,
}
Expand Down Expand Up @@ -1852,9 +1851,9 @@ pub enum FormalParameterKind {
#[estree(rename = "BlockStatement")]
pub struct FunctionBody<'a> {
pub span: Span,
#[estree(rename = "body")]
#[estree(prepend_to = "statements")]
pub directives: Vec<'a, Directive<'a>>,
#[estree(append_to = "directives")]
#[estree(rename = "body")]
pub statements: Vec<'a, Statement<'a>>,
}

Expand Down
3 changes: 1 addition & 2 deletions crates/oxc_ast/src/ast/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,9 +1262,8 @@ pub enum TSModuleDeclarationBody<'a> {
#[generate_derive(CloneIn, Dummy, TakeIn, GetSpan, GetSpanMut, ContentEq, ESTree)]
pub struct TSModuleBlock<'a> {
pub span: Span,
#[estree(rename = "body")]
#[estree(prepend_to = "body")]
pub directives: Vec<'a, Directive<'a>>,
#[estree(append_to = "directives")]
pub body: Vec<'a, Statement<'a>>,
}

Expand Down
Loading