Skip to content

Commit

Permalink
Fixed dumping AST to Json not working
Browse files Browse the repository at this point in the history
Some of the fields in AST structs were both

1. Arrays
2. Marked as 'flatten'

This is illegal per serde docs (and doesn't really make sense).
The fix is to remove the attribute.

See: https://serde.rs/attr-flatten.html
Fixes: #1920
  • Loading branch information
Taras Boiko committed Mar 20, 2022
1 parent 3b4708c commit 484362b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion boa_engine/src/syntax/ast/node/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ mod tests;
#[cfg_attr(feature = "deser", derive(Serialize, Deserialize))]
#[derive(Clone, Debug, Trace, Finalize, PartialEq)]
pub struct ArrayDecl {
#[cfg_attr(feature = "deser", serde(flatten))]
arr: Box<[Node]>,
has_trailing_comma_spread: bool,
}
Expand Down
1 change: 0 additions & 1 deletion boa_engine/src/syntax/ast/node/statement_list/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ mod tests;
#[cfg_attr(feature = "deser", derive(Serialize, Deserialize))]
#[derive(Clone, Debug, Trace, Finalize, PartialEq)]
pub struct StatementList {
#[cfg_attr(feature = "deser", serde(flatten))]
items: Box<[Node]>,
strict: bool,
}
Expand Down

0 comments on commit 484362b

Please sign in to comment.