JsModule { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ JsExpressionStatement { expression: JsParenthesizedExpression { l_paren_token: L_PAREN@0..1 "(" [] [], expression: JsAssignmentExpression { left: JsArrayAssignmentPattern { l_brack_token: L_BRACK@1..3 "[" [] [Whitespace(" ")], elements: JsArrayAssignmentPatternElementList [ JsArrayAssignmentPatternRestElement { dotdotdot_token: DOT3@3..7 "..." [] [Whitespace(" ")], pattern: missing (required), }, ], r_brack_token: R_BRACK@7..9 "]" [] [Whitespace(" ")], }, operator_token: EQ@9..11 "=" [] [Whitespace(" ")], right: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@11..12 "a" [] [], }, }, }, r_paren_token: R_PAREN@12..13 ")" [] [], }, semicolon_token: SEMICOLON@13..14 ";" [] [], }, JsExpressionStatement { expression: JsParenthesizedExpression { l_paren_token: L_PAREN@14..16 "(" [Newline("\n")] [], expression: JsBogusExpression { items: [ JsBogus { items: [ L_BRACK@16..18 "[" [] [Whitespace(" ")], JsBogus { items: [ JsBogus { items: [ DOT3@18..21 "..." [] [], JsIdentifierAssignment { name_token: IDENT@21..23 "c" [] [Whitespace(" ")], }, EQ@23..25 "=" [] [Whitespace(" ")], JS_STRING_LITERAL@25..35 "\"default\"" [] [Whitespace(" ")], ], }, ], }, R_BRACK@35..37 "]" [] [Whitespace(" ")], ], }, EQ@37..39 "=" [] [Whitespace(" ")], JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@39..40 "a" [] [], }, }, ], }, r_paren_token: R_PAREN@40..41 ")" [] [], }, semicolon_token: SEMICOLON@41..42 ";" [] [], }, JsExpressionStatement { expression: JsParenthesizedExpression { l_paren_token: L_PAREN@42..44 "(" [Newline("\n")] [], expression: JsBogusExpression { items: [ JsBogus { items: [ L_BRACK@44..46 "[" [] [Whitespace(" ")], JsBogus { items: [ JsBogus { items: [ DOT3@46..49 "..." [] [], JsIdentifierAssignment { name_token: IDENT@49..53 "rest" [] [], }, ], }, COMMA@53..55 "," [] [Whitespace(" ")], JsArrayAssignmentPatternElement { pattern: JsIdentifierAssignment { name_token: IDENT@55..72 "other_assignment" [] [Whitespace(" ")], }, init: missing (optional), }, ], }, R_BRACK@72..74 "]" [] [Whitespace(" ")], ], }, EQ@74..76 "=" [] [Whitespace(" ")], JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@76..77 "a" [] [], }, }, ], }, r_paren_token: R_PAREN@77..78 ")" [] [], }, semicolon_token: SEMICOLON@78..79 ";" [] [], }, ], eof_token: EOF@79..80 "" [Newline("\n")] [], } 0: JS_MODULE@0..80 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..79 0: JS_EXPRESSION_STATEMENT@0..14 0: JS_PARENTHESIZED_EXPRESSION@0..13 0: L_PAREN@0..1 "(" [] [] 1: JS_ASSIGNMENT_EXPRESSION@1..12 0: JS_ARRAY_ASSIGNMENT_PATTERN@1..9 0: L_BRACK@1..3 "[" [] [Whitespace(" ")] 1: JS_ARRAY_ASSIGNMENT_PATTERN_ELEMENT_LIST@3..7 0: JS_ARRAY_ASSIGNMENT_PATTERN_REST_ELEMENT@3..7 0: DOT3@3..7 "..." [] [Whitespace(" ")] 1: (empty) 2: R_BRACK@7..9 "]" [] [Whitespace(" ")] 1: EQ@9..11 "=" [] [Whitespace(" ")] 2: JS_IDENTIFIER_EXPRESSION@11..12 0: JS_REFERENCE_IDENTIFIER@11..12 0: IDENT@11..12 "a" [] [] 2: R_PAREN@12..13 ")" [] [] 1: SEMICOLON@13..14 ";" [] [] 1: JS_EXPRESSION_STATEMENT@14..42 0: JS_PARENTHESIZED_EXPRESSION@14..41 0: L_PAREN@14..16 "(" [Newline("\n")] [] 1: JS_BOGUS_EXPRESSION@16..40 0: JS_BOGUS@16..37 0: L_BRACK@16..18 "[" [] [Whitespace(" ")] 1: JS_BOGUS@18..35 0: JS_BOGUS@18..35 0: DOT3@18..21 "..." [] [] 1: JS_IDENTIFIER_ASSIGNMENT@21..23 0: IDENT@21..23 "c" [] [Whitespace(" ")] 2: EQ@23..25 "=" [] [Whitespace(" ")] 3: JS_STRING_LITERAL@25..35 "\"default\"" [] [Whitespace(" ")] 2: R_BRACK@35..37 "]" [] [Whitespace(" ")] 1: EQ@37..39 "=" [] [Whitespace(" ")] 2: JS_IDENTIFIER_EXPRESSION@39..40 0: JS_REFERENCE_IDENTIFIER@39..40 0: IDENT@39..40 "a" [] [] 2: R_PAREN@40..41 ")" [] [] 1: SEMICOLON@41..42 ";" [] [] 2: JS_EXPRESSION_STATEMENT@42..79 0: JS_PARENTHESIZED_EXPRESSION@42..78 0: L_PAREN@42..44 "(" [Newline("\n")] [] 1: JS_BOGUS_EXPRESSION@44..77 0: JS_BOGUS@44..74 0: L_BRACK@44..46 "[" [] [Whitespace(" ")] 1: JS_BOGUS@46..72 0: JS_BOGUS@46..53 0: DOT3@46..49 "..." [] [] 1: JS_IDENTIFIER_ASSIGNMENT@49..53 0: IDENT@49..53 "rest" [] [] 1: COMMA@53..55 "," [] [Whitespace(" ")] 2: JS_ARRAY_ASSIGNMENT_PATTERN_ELEMENT@55..72 0: JS_IDENTIFIER_ASSIGNMENT@55..72 0: IDENT@55..72 "other_assignment" [] [Whitespace(" ")] 1: (empty) 2: R_BRACK@72..74 "]" [] [Whitespace(" ")] 1: EQ@74..76 "=" [] [Whitespace(" ")] 2: JS_IDENTIFIER_EXPRESSION@76..77 0: JS_REFERENCE_IDENTIFIER@76..77 0: IDENT@76..77 "a" [] [] 2: R_PAREN@77..78 ")" [] [] 1: SEMICOLON@78..79 ";" [] [] 4: EOF@79..80 "" [Newline("\n")] [] -- array_assignment_target_rest_err.js:1:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier, or an assignment target but instead found ''. > 1 │ ([ ... ] = a); │ 2 │ ([ ...c = "default" ] = a); 3 │ ([ ...rest, other_assignment ] = a); i Expected an identifier, or an assignment target here. > 1 │ ([ ... ] = a); │ 2 │ ([ ...c = "default" ] = a); 3 │ ([ ...rest, other_assignment ] = a); -- array_assignment_target_rest_err.js:2:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × rest element cannot have a default 1 │ ([ ... ] = a); > 2 │ ([ ...c = "default" ] = a); │ ^^^^^^^^^^^^ 3 │ ([ ...rest, other_assignment ] = a); 4 │ i Remove the default value here 1 │ ([ ... ] = a); > 2 │ ([ ...c = "default" ] = a); │ ^^^^^^^^^^^^ 3 │ ([ ...rest, other_assignment ] = a); 4 │ i Rest element 1 │ ([ ... ] = a); > 2 │ ([ ...c = "default" ] = a); │ ^^^^ 3 │ ([ ...rest, other_assignment ] = a); 4 │ -- array_assignment_target_rest_err.js:3:4 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × rest element must be the last element 1 │ ([ ... ] = a); 2 │ ([ ...c = "default" ] = a); > 3 │ ([ ...rest, other_assignment ] = a); │ ^^^^^^^ 4 │ i Move the rest element to the end of the pattern, right before the closing ']' -- ([ ... ] = a); ([ ...c = "default" ] = a); ([ ...rest, other_assignment ] = a);