@ -6,7 +6,6 @@ use crate::syntax::ast::node::{
statement_list ::StatementList ,
statement_list ::StatementList ,
Identifier , Node ,
Identifier , Node ,
} ;
} ;
use boa_gc ::{ Finalize , Trace } ;
use boa_interner ::{ Interner , Sym , ToInternedString } ;
use boa_interner ::{ Interner , Sym , ToInternedString } ;
#[ cfg(feature = " deser " ) ]
#[ cfg(feature = " deser " ) ]
@ -34,7 +33,7 @@ pub use self::{
mod tests ;
mod tests ;
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ derive(Clone, Debug, Trace, Finalize, PartialEq) ]
#[ derive(Clone, Debug, PartialEq) ]
pub enum DeclarationList {
pub enum DeclarationList {
/// The `const` statements are block-scoped, much like variables defined using the `let`
/// The `const` statements are block-scoped, much like variables defined using the `let`
/// keyword.
/// keyword.
@ -154,7 +153,7 @@ impl From<Declaration> for Box<[Declaration]> {
/// [spec2]: https://tc39.es/ecma262/#prod-VariableDeclaration
/// [spec2]: https://tc39.es/ecma262/#prod-VariableDeclaration
/// [spec3]: https://tc39.es/ecma262/#sec-declarations-and-the-variable-statement
/// [spec3]: https://tc39.es/ecma262/#sec-declarations-and-the-variable-statement
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ derive(Clone, Debug, Trace, Finalize, PartialEq) ]
#[ derive(Clone, Debug, PartialEq) ]
pub enum Declaration {
pub enum Declaration {
Identifier {
Identifier {
ident : Identifier ,
ident : Identifier ,
@ -241,7 +240,7 @@ impl Declaration {
///
///
/// [spec1]: https://tc39.es/ecma262/#prod-BindingPattern
/// [spec1]: https://tc39.es/ecma262/#prod-BindingPattern
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ derive(Clone, Debug, Trace, Finalize, PartialEq) ]
#[ derive(Clone, Debug, PartialEq) ]
pub enum DeclarationPattern {
pub enum DeclarationPattern {
Object ( DeclarationPatternObject ) ,
Object ( DeclarationPatternObject ) ,
Array ( DeclarationPatternArray ) ,
Array ( DeclarationPatternArray ) ,
@ -395,7 +394,7 @@ impl DeclarationPattern {
///
///
/// [spec1]: https://tc39.es/ecma262/#prod-ObjectBindingPattern
/// [spec1]: https://tc39.es/ecma262/#prod-ObjectBindingPattern
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ derive(Clone, Debug, Trace, Finalize, PartialEq) ]
#[ derive(Clone, Debug, PartialEq) ]
pub struct DeclarationPatternObject {
pub struct DeclarationPatternObject {
bindings : Vec < BindingPatternTypeObject > ,
bindings : Vec < BindingPatternTypeObject > ,
init : Option < Node > ,
init : Option < Node > ,
@ -494,7 +493,7 @@ impl DeclarationPatternObject {
///
///
/// [spec1]: https://tc39.es/ecma262/#prod-ArrayBindingPattern
/// [spec1]: https://tc39.es/ecma262/#prod-ArrayBindingPattern
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ derive(Clone, Debug, Trace, Finalize, PartialEq) ]
#[ derive(Clone, Debug, PartialEq) ]
pub struct DeclarationPatternArray {
pub struct DeclarationPatternArray {
bindings : Vec < BindingPatternTypeArray > ,
bindings : Vec < BindingPatternTypeArray > ,
init : Option < Node > ,
init : Option < Node > ,
@ -588,7 +587,7 @@ impl DeclarationPatternArray {
///
///
/// [spec1]: https://tc39.es/ecma262/#prod-ObjectBindingPattern
/// [spec1]: https://tc39.es/ecma262/#prod-ObjectBindingPattern
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ derive(Clone, Debug, Trace, Finalize, PartialEq) ]
#[ derive(Clone, Debug, PartialEq) ]
pub enum BindingPatternTypeObject {
pub enum BindingPatternTypeObject {
/// Empty represents an empty object binding pattern e.g. `{ }`.
/// Empty represents an empty object binding pattern e.g. `{ }`.
Empty ,
Empty ,
@ -732,7 +731,7 @@ impl ToInternedString for BindingPatternTypeObject {
///
///
/// [spec1]: https://tc39.es/ecma262/#prod-ArrayBindingPattern
/// [spec1]: https://tc39.es/ecma262/#prod-ArrayBindingPattern
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ cfg_attr(feature = " deser " , derive(Serialize, Deserialize)) ]
#[ derive(Clone, Debug, Trace, Finalize, PartialEq) ]
#[ derive(Clone, Debug, PartialEq) ]
pub enum BindingPatternTypeArray {
pub enum BindingPatternTypeArray {
/// Empty represents an empty array binding pattern e.g. `[ ]`.
/// Empty represents an empty array binding pattern e.g. `[ ]`.
///
///