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: JsObjectBindingPattern { l_curly_token: L_CURLY@4..6 "{" [] [Whitespace(" ")], properties: JsObjectBindingPatternPropertyList [ JsObjectBindingPatternRest { dotdotdot_token: DOT3@6..10 "..." [] [Whitespace(" ")], binding: missing (required), }, ], r_curly_token: R_CURLY@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_CURLY@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_CURLY@40..42 "}" [] [Whitespace(" ")], ], }, JsInitializerClause { eq_token: EQ@42..44 "=" [] [Whitespace(" ")], expression: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@44..45 "a" [] [], }, }, }, ], }, ], }, ], }, SEMICOLON@45..46 ";" [] [], ], }, JsVariableStatement { declaration: JsVariableDeclaration { await_token: missing (optional), kind: LET_KW@46..51 "let" [Newline("\n")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsObjectBindingPattern { l_curly_token: L_CURLY@51..53 "{" [] [Whitespace(" ")], properties: JsObjectBindingPatternPropertyList [ JsObjectBindingPatternRest { dotdotdot_token: DOT3@53..56 "..." [] [], binding: JsBogusBinding { items: [ L_CURLY@56..57 "{" [] [], JsObjectBindingPatternPropertyList [ JsObjectBindingPatternShorthandProperty { identifier: JsIdentifierBinding { name_token: IDENT@57..58 "a" [] [], }, init: missing (optional), }, ], R_CURLY@58..60 "}" [] [Whitespace(" ")], ], }, }, ], r_curly_token: R_CURLY@60..62 "}" [] [Whitespace(" ")], }, variable_annotation: missing (optional), initializer: JsInitializerClause { eq_token: EQ@62..64 "=" [] [Whitespace(" ")], expression: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@64..65 "b" [] [], }, }, }, }, ], }, semicolon_token: SEMICOLON@65..66 ";" [] [], }, JsBogusStatement { items: [ JsBogus { items: [ LET_KW@66..71 "let" [Newline("\n")] [Whitespace(" ")], JsBogus { items: [ JsBogus { items: [ JsBogus { items: [ L_CURLY@71..73 "{" [] [Whitespace(" ")], JsBogus { items: [ JsBogus { items: [ DOT3@73..76 "..." [] [], JsIdentifierBinding { name_token: IDENT@76..80 "rest" [] [], }, ], }, COMMA@80..82 "," [] [Whitespace(" ")], JsObjectBindingPatternShorthandProperty { identifier: JsIdentifierBinding { name_token: IDENT@82..99 "other_assignment" [] [Whitespace(" ")], }, init: missing (optional), }, ], }, R_CURLY@99..101 "}" [] [Whitespace(" ")], ], }, JsInitializerClause { eq_token: EQ@101..103 "=" [] [Whitespace(" ")], expression: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@103..104 "a" [] [], }, }, }, ], }, ], }, ], }, SEMICOLON@104..105 ";" [] [], ], }, JsBogusStatement { items: [ JsBogus { items: [ LET_KW@105..110 "let" [Newline("\n")] [Whitespace(" ")], JsBogus { items: [ JsBogus { items: [ JsBogus { items: [ L_CURLY@110..112 "{" [] [Whitespace(" ")], JsBogus { items: [ JsBogus { items: [ DOT3@112..115 "..." [] [], JsIdentifierBinding { name_token: IDENT@115..120 "rest2" [] [], }, ], }, COMMA@120..122 "," [] [Whitespace(" ")], ], }, R_CURLY@122..124 "}" [] [Whitespace(" ")], ], }, JsInitializerClause { eq_token: EQ@124..126 "=" [] [Whitespace(" ")], expression: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@126..127 "a" [] [], }, }, }, ], }, ], }, ], }, SEMICOLON@127..128 ";" [] [], ], }, JsFunctionDeclaration { async_token: ASYNC_KW@128..135 "async" [Newline("\n")] [Whitespace(" ")], function_token: FUNCTION_KW@135..144 "function" [] [Whitespace(" ")], star_token: missing (optional), id: JsIdentifierBinding { name_token: IDENT@144..148 "test" [] [], }, type_parameters: missing (optional), parameters: JsParameters { l_paren_token: L_PAREN@148..149 "(" [] [], items: JsParameterList [], r_paren_token: R_PAREN@149..151 ")" [] [Whitespace(" ")], }, return_type_annotation: missing (optional), body: JsFunctionBody { l_curly_token: L_CURLY@151..152 "{" [] [], directives: JsDirectiveList [], statements: JsStatementList [ JsVariableStatement { declaration: JsVariableDeclaration { await_token: missing (optional), kind: LET_KW@152..159 "let" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], declarators: JsVariableDeclaratorList [ JsVariableDeclarator { id: JsObjectBindingPattern { l_curly_token: L_CURLY@159..161 "{" [] [Whitespace(" ")], properties: JsObjectBindingPatternPropertyList [ JsObjectBindingPatternRest { dotdotdot_token: DOT3@161..164 "..." [] [], binding: JsBogusBinding { items: [ IDENT@164..170 "await" [] [Whitespace(" ")], ], }, }, ], r_curly_token: R_CURLY@170..172 "}" [] [Whitespace(" ")], }, variable_annotation: missing (optional), initializer: JsInitializerClause { eq_token: EQ@172..174 "=" [] [Whitespace(" ")], expression: JsIdentifierExpression { name: JsReferenceIdentifier { value_token: IDENT@174..175 "a" [] [], }, }, }, }, ], }, semicolon_token: SEMICOLON@175..176 ";" [] [], }, ], r_curly_token: R_CURLY@176..178 "}" [Newline("\n")] [], }, }, ], eof_token: EOF@178..179 "" [Newline("\n")] [], } 0: JS_MODULE@0..179 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..178 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_OBJECT_BINDING_PATTERN@4..12 0: L_CURLY@4..6 "{" [] [Whitespace(" ")] 1: JS_OBJECT_BINDING_PATTERN_PROPERTY_LIST@6..10 0: JS_OBJECT_BINDING_PATTERN_REST@6..10 0: DOT3@6..10 "..." [] [Whitespace(" ")] 1: (empty) 2: R_CURLY@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_CURLY@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_CURLY@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_VARIABLE_STATEMENT@46..66 0: JS_VARIABLE_DECLARATION@46..65 0: (empty) 1: LET_KW@46..51 "let" [Newline("\n")] [Whitespace(" ")] 2: JS_VARIABLE_DECLARATOR_LIST@51..65 0: JS_VARIABLE_DECLARATOR@51..65 0: JS_OBJECT_BINDING_PATTERN@51..62 0: L_CURLY@51..53 "{" [] [Whitespace(" ")] 1: JS_OBJECT_BINDING_PATTERN_PROPERTY_LIST@53..60 0: JS_OBJECT_BINDING_PATTERN_REST@53..60 0: DOT3@53..56 "..." [] [] 1: JS_BOGUS_BINDING@56..60 0: L_CURLY@56..57 "{" [] [] 1: JS_OBJECT_BINDING_PATTERN_PROPERTY_LIST@57..58 0: JS_OBJECT_BINDING_PATTERN_SHORTHAND_PROPERTY@57..58 0: JS_IDENTIFIER_BINDING@57..58 0: IDENT@57..58 "a" [] [] 1: (empty) 2: R_CURLY@58..60 "}" [] [Whitespace(" ")] 2: R_CURLY@60..62 "}" [] [Whitespace(" ")] 1: (empty) 2: JS_INITIALIZER_CLAUSE@62..65 0: EQ@62..64 "=" [] [Whitespace(" ")] 1: JS_IDENTIFIER_EXPRESSION@64..65 0: JS_REFERENCE_IDENTIFIER@64..65 0: IDENT@64..65 "b" [] [] 1: SEMICOLON@65..66 ";" [] [] 3: JS_BOGUS_STATEMENT@66..105 0: JS_BOGUS@66..104 0: LET_KW@66..71 "let" [Newline("\n")] [Whitespace(" ")] 1: JS_BOGUS@71..104 0: JS_BOGUS@71..104 0: JS_BOGUS@71..101 0: L_CURLY@71..73 "{" [] [Whitespace(" ")] 1: JS_BOGUS@73..99 0: JS_BOGUS@73..80 0: DOT3@73..76 "..." [] [] 1: JS_IDENTIFIER_BINDING@76..80 0: IDENT@76..80 "rest" [] [] 1: COMMA@80..82 "," [] [Whitespace(" ")] 2: JS_OBJECT_BINDING_PATTERN_SHORTHAND_PROPERTY@82..99 0: JS_IDENTIFIER_BINDING@82..99 0: IDENT@82..99 "other_assignment" [] [Whitespace(" ")] 1: (empty) 2: R_CURLY@99..101 "}" [] [Whitespace(" ")] 1: JS_INITIALIZER_CLAUSE@101..104 0: EQ@101..103 "=" [] [Whitespace(" ")] 1: JS_IDENTIFIER_EXPRESSION@103..104 0: JS_REFERENCE_IDENTIFIER@103..104 0: IDENT@103..104 "a" [] [] 1: SEMICOLON@104..105 ";" [] [] 4: JS_BOGUS_STATEMENT@105..128 0: JS_BOGUS@105..127 0: LET_KW@105..110 "let" [Newline("\n")] [Whitespace(" ")] 1: JS_BOGUS@110..127 0: JS_BOGUS@110..127 0: JS_BOGUS@110..124 0: L_CURLY@110..112 "{" [] [Whitespace(" ")] 1: JS_BOGUS@112..122 0: JS_BOGUS@112..120 0: DOT3@112..115 "..." [] [] 1: JS_IDENTIFIER_BINDING@115..120 0: IDENT@115..120 "rest2" [] [] 1: COMMA@120..122 "," [] [Whitespace(" ")] 2: R_CURLY@122..124 "}" [] [Whitespace(" ")] 1: JS_INITIALIZER_CLAUSE@124..127 0: EQ@124..126 "=" [] [Whitespace(" ")] 1: JS_IDENTIFIER_EXPRESSION@126..127 0: JS_REFERENCE_IDENTIFIER@126..127 0: IDENT@126..127 "a" [] [] 1: SEMICOLON@127..128 ";" [] [] 5: JS_FUNCTION_DECLARATION@128..178 0: ASYNC_KW@128..135 "async" [Newline("\n")] [Whitespace(" ")] 1: FUNCTION_KW@135..144 "function" [] [Whitespace(" ")] 2: (empty) 3: JS_IDENTIFIER_BINDING@144..148 0: IDENT@144..148 "test" [] [] 4: (empty) 5: JS_PARAMETERS@148..151 0: L_PAREN@148..149 "(" [] [] 1: JS_PARAMETER_LIST@149..149 2: R_PAREN@149..151 ")" [] [Whitespace(" ")] 6: (empty) 7: JS_FUNCTION_BODY@151..178 0: L_CURLY@151..152 "{" [] [] 1: JS_DIRECTIVE_LIST@152..152 2: JS_STATEMENT_LIST@152..176 0: JS_VARIABLE_STATEMENT@152..176 0: JS_VARIABLE_DECLARATION@152..175 0: (empty) 1: LET_KW@152..159 "let" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 2: JS_VARIABLE_DECLARATOR_LIST@159..175 0: JS_VARIABLE_DECLARATOR@159..175 0: JS_OBJECT_BINDING_PATTERN@159..172 0: L_CURLY@159..161 "{" [] [Whitespace(" ")] 1: JS_OBJECT_BINDING_PATTERN_PROPERTY_LIST@161..170 0: JS_OBJECT_BINDING_PATTERN_REST@161..170 0: DOT3@161..164 "..." [] [] 1: JS_BOGUS_BINDING@164..170 0: IDENT@164..170 "await" [] [Whitespace(" ")] 2: R_CURLY@170..172 "}" [] [Whitespace(" ")] 1: (empty) 2: JS_INITIALIZER_CLAUSE@172..175 0: EQ@172..174 "=" [] [Whitespace(" ")] 1: JS_IDENTIFIER_EXPRESSION@174..175 0: JS_REFERENCE_IDENTIFIER@174..175 0: IDENT@174..175 "a" [] [] 1: SEMICOLON@175..176 ";" [] [] 3: R_CURLY@176..178 "}" [Newline("\n")] [] 4: EOF@178..179 "" [Newline("\n")] [] -- rest_property_binding_err.js:1:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected an identifier but instead found '}'. > 1 │ let { ... } = a; │ ^ 2 │ let { ...c = "default" } = a; 3 │ let { ...{a} } = b; i Expected an identifier here. > 1 │ let { ... } = a; │ ^ 2 │ let { ...c = "default" } = a; 3 │ let { ...{a} } = b; -- rest_property_binding_err.js:2:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × rest element cannot have a default 1 │ let { ... } = a; > 2 │ let { ...c = "default" } = a; │ ^^^^^^^^^^^^ 3 │ let { ...{a} } = b; 4 │ let { ...rest, other_assignment } = a; i Remove the default value here 1 │ let { ... } = a; > 2 │ let { ...c = "default" } = a; │ ^^^^^^^^^^^^ 3 │ let { ...{a} } = b; 4 │ let { ...rest, other_assignment } = a; i Rest element 1 │ let { ... } = a; > 2 │ let { ...c = "default" } = a; │ ^^^^ 3 │ let { ...{a} } = b; 4 │ let { ...rest, other_assignment } = a; -- rest_property_binding_err.js:3:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Expected identifier binding 1 │ let { ... } = a; 2 │ let { ...c = "default" } = a; > 3 │ let { ...{a} } = b; │ ^^^ 4 │ let { ...rest, other_assignment } = a; 5 │ let { ...rest2, } = a; i Object rest patterns must bind to an identifier, other patterns are not allowed. -- rest_property_binding_err.js:4:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × rest element must be the last element 2 │ let { ...c = "default" } = a; 3 │ let { ...{a} } = b; > 4 │ let { ...rest, other_assignment } = a; │ ^^^^^^^ 5 │ let { ...rest2, } = a; 6 │ async function test() { i Move the rest element to the end of the pattern, right before the closing '}' -- rest_property_binding_err.js:5:15 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × rest element may not have a trailing comma 3 │ let { ...{a} } = b; 4 │ let { ...rest, other_assignment } = a; > 5 │ let { ...rest2, } = a; │ ^ 6 │ async function test() { 7 │ let { ...await } = a; i Remove the trailing comma here 3 │ let { ...{a} } = b; 4 │ let { ...rest, other_assignment } = a; > 5 │ let { ...rest2, } = a; │ ^ 6 │ async function test() { 7 │ let { ...await } = a; i Rest element 3 │ let { ...{a} } = b; 4 │ let { ...rest, other_assignment } = a; > 5 │ let { ...rest2, } = a; │ ^^^^^^^^ 6 │ async function test() { 7 │ let { ...await } = a; -- rest_property_binding_err.js:7:12 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Illegal use of `await` as an identifier in an async context 5 │ let { ...rest2, } = a; 6 │ async function test() { > 7 │ let { ...await } = a; │ ^^^^^ 8 │ } 9 │ -- let { ... } = a; let { ...c = "default" } = a; let { ...{a} } = b; let { ...rest, other_assignment } = a; let { ...rest2, } = a; async function test() { let { ...await } = a; }