JsModule { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ JsVariableStatement { declaration: JsVariableDeclaration { await_token: missing (optional), kind: LET_KW@0..4 "let" [] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsArrayBindingPattern { l_brack_token: L_BRACK@4..6 "[" [] [Whitespace(" ")], elements: JsArrayBindingPatternElementList [ JsArrayBindingPatternRestElement { dotdotdot_token: DOT3@6..10 "..." [] [Whitespace(" ")], pattern: missing (required), }, ], r_brack_token: R_BRACK@10..12 "]" [] [Whitespace(" ")], }, variable_annotation: missing (optional), initializer: JsInitializerClause { eq_token: EQ@12..14 "=" [] [Whitespace(" ")], expression: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@14..15 "a" [] [], }, }, }, }, ], }, semicolon_token: SEMICOLON@15..16 ";" [] [], }, JsBogusStatement { items: [ JsBogus { items: [ LET_KW@16..21 "let" [Newline("\n")] [Whitespace(" ")], JsBogus { items: [ JsBogus { items: [ JsBogus { items: [ L_BRACK@21..23 "[" [] [Whitespace(" ")], JsBogus { items: [ JsBogus { items: [ DOT3@23..26 "..." [] [], JsIdentifierBinding { name_token: IDENT@26..28 "c" [] [Whitespace(" ")], }, EQ@28..30 "=" [] [Whitespace(" ")], JS_STRING_LITERAL@30..40 "\"default\"" [] [Whitespace(" ")], ], }, ], }, R_BRACK@40..42 "]" [] [Whitespace(" ")], ], }, JsInitializerClause { eq_token: EQ@42..44 "=" [] [Whitespace(" ")], expression: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@44..45 "a" [] [], }, }, }, ], }, ], }, ], }, SEMICOLON@45..46 ";" [] [], ], }, JsBogusStatement { items: [ JsBogus { items: [ LET_KW@46..51 "let" [Newline("\n")] [Whitespace(" ")], JsBogus { items: [ JsBogus { items: [ JsBogus { items: [ L_BRACK@51..53 "[" [] [Whitespace(" ")], JsBogus { items: [ JsBogus { items: [ DOT3@53..56 "..." [] [], JsIdentifierBinding { name_token: IDENT@56..60 "rest" [] [], }, ], }, COMMA@60..62 "," [] [Whitespace(" ")], JsArrayBindingPatternElement { pattern: JsIdentifierBinding { name_token: IDENT@62..79 "other_assignment" [] [Whitespace(" ")], }, init: missing (optional), }, ], }, R_BRACK@79..81 "]" [] [Whitespace(" ")], ], }, JsInitializerClause { eq_token: EQ@81..83 "=" [] [Whitespace(" ")], expression: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@83..84 "a" [] [], }, }, }, ], }, ], }, ], }, SEMICOLON@84..85 ";" [] [], ], }, ], eof_token: EOF@85..86 "" [Newline("\n")] [], } 0: JS_MODULE@0..86 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..85 0: JS_VARIABLE_STATEMENT@0..16 0: JS_VARIABLE_DECLARATION@0..15 0: (empty) 1: LET_KW@0..4 "let" [] [Whitespace(" ")] 2: JS_VARIABLE_DECLARATOR_LIST@4..15 0: JS_VARIABLE_DECLARATOR@4..15 0: JS_ARRAY_BINDING_PATTERN@4..12 0: L_BRACK@4..6 "[" [] [Whitespace(" ")] 1: JS_ARRAY_BINDING_PATTERN_ELEMENT_LIST@6..10 0: JS_ARRAY_BINDING_PATTERN_REST_ELEMENT@6..10 0: DOT3@6..10 "..." [] [Whitespace(" ")] 1: (empty) 2: R_BRACK@10..12 "]" [] [Whitespace(" ")] 1: (empty) 2: JS_INITIALIZER_CLAUSE@12..15 0: EQ@12..14 "=" [] [Whitespace(" ")] 1: JS_IDENTIFIER_EXPRESSION@14..15 0: JS_REFERENCE_IDENTIFIER@14..15 0: IDENT@14..15 "a" [] [] 1: SEMICOLON@15..16 ";" [] [] 1: JS_BOGUS_STATEMENT@16..46 0: JS_BOGUS@16..45 0: LET_KW@16..21 "let" [Newline("\n")] [Whitespace(" ")] 1: JS_BOGUS@21..45 0: JS_BOGUS@21..45 0: JS_BOGUS@21..42 0: L_BRACK@21..23 "[" [] [Whitespace(" ")] 1: JS_BOGUS@23..40 0: JS_BOGUS@23..40 0: DOT3@23..26 "..." [] [] 1: JS_IDENTIFIER_BINDING@26..28 0: IDENT@26..28 "c" [] [Whitespace(" ")] 2: EQ@28..30 "=" [] [Whitespace(" ")] 3: JS_STRING_LITERAL@30..40 "\"default\"" [] [Whitespace(" ")] 2: R_BRACK@40..42 "]" [] [Whitespace(" ")] 1: JS_INITIALIZER_CLAUSE@42..45 0: EQ@42..44 "=" [] [Whitespace(" ")] 1: JS_IDENTIFIER_EXPRESSION@44..45 0: JS_REFERENCE_IDENTIFIER@44..45 0: IDENT@44..45 "a" [] [] 1: SEMICOLON@45..46 ";" [] [] 2: JS_BOGUS_STATEMENT@46..85 0: JS_BOGUS@46..84 0: LET_KW@46..51 "let" [Newline("\n")] [Whitespace(" ")] 1: JS_BOGUS@51..84 0: JS_BOGUS@51..84 0: JS_BOGUS@51..81 0: L_BRACK@51..53 "[" [] [Whitespace(" ")] 1: JS_BOGUS@53..79 0: JS_BOGUS@53..60 0: DOT3@53..56 "..." [] [] 1: JS_IDENTIFIER_BINDING@56..60 0: IDENT@56..60 "rest" [] [] 1: COMMA@60..62 "," [] [Whitespace(" ")] 2: JS_ARRAY_BINDING_PATTERN_ELEMENT@62..79 0: JS_IDENTIFIER_BINDING@62..79 0: IDENT@62..79 "other_assignment" [] [Whitespace(" ")] 1: (empty) 2: R_BRACK@79..81 "]" [] [Whitespace(" ")] 1: JS_INITIALIZER_CLAUSE@81..84 0: EQ@81..83 "=" [] [Whitespace(" ")] 1: JS_IDENTIFIER_EXPRESSION@83..84 0: JS_REFERENCE_IDENTIFIER@83..84 0: IDENT@83..84 "a" [] [] 1: SEMICOLON@84..85 ";" [] [] 4: EOF@85..86 "" [Newline("\n")] [] -- array_binding_rest_err.js:1:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier, an array pattern, or an object pattern but instead found ''. > 1 │ let [ ... ] = a; │ 2 │ let [ ...c = "default" ] = a; 3 │ let [ ...rest, other_assignment ] = a; i Expected an identifier, an array pattern, or an object pattern here. > 1 │ let [ ... ] = a; │ 2 │ let [ ...c = "default" ] = a; 3 │ let [ ...rest, other_assignment ] = a; -- array_binding_rest_err.js:2:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × rest element cannot have a default 1 │ let [ ... ] = a; > 2 │ let [ ...c = "default" ] = a; │ ^^^^^^^^^^^^ 3 │ let [ ...rest, other_assignment ] = a; 4 │ i Remove the default value here 1 │ let [ ... ] = a; > 2 │ let [ ...c = "default" ] = a; │ ^^^^^^^^^^^^ 3 │ let [ ...rest, other_assignment ] = a; 4 │ i Rest element 1 │ let [ ... ] = a; > 2 │ let [ ...c = "default" ] = a; │ ^^^^ 3 │ let [ ...rest, other_assignment ] = a; 4 │ -- array_binding_rest_err.js:3:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × rest element must be the last element 1 │ let [ ... ] = a; 2 │ let [ ...c = "default" ] = a; > 3 │ let [ ...rest, other_assignment ] = a; │ ^^^^^^^ 4 │ i Move the rest element to the end of the pattern, right before the closing ']' -- let [ ... ] = a; let [ ...c = "default" ] = a; let [ ...rest, other_assignment ] = a;