()
| 1017 | } |
| 1018 | |
| 1019 | parseGroupExpression(): ArrowParameterPlaceHolderNode | Node.Expression { |
| 1020 | let expr; |
| 1021 | |
| 1022 | this.expect('('); |
| 1023 | if (this.match(')')) { |
| 1024 | this.nextToken(); |
| 1025 | if (!this.match('=>')) { |
| 1026 | this.expect('=>'); |
| 1027 | } |
| 1028 | expr = { |
| 1029 | type: ArrowParameterPlaceHolder, |
| 1030 | params: [], |
| 1031 | async: false |
| 1032 | }; |
| 1033 | } else { |
| 1034 | const startToken = this.lookahead; |
| 1035 | const params = []; |
| 1036 | if (this.match('...')) { |
| 1037 | expr = this.parseRestElement(params); |
| 1038 | this.expect(')'); |
| 1039 | if (!this.match('=>')) { |
| 1040 | this.expect('=>'); |
| 1041 | } |
| 1042 | expr = { |
| 1043 | type: ArrowParameterPlaceHolder, |
| 1044 | params: [expr], |
| 1045 | async: false |
| 1046 | }; |
| 1047 | } else { |
| 1048 | let arrow = false; |
| 1049 | this.context.isBindingElement = true; |
| 1050 | expr = this.inheritCoverGrammar(this.parseAssignmentExpression); |
| 1051 | |
| 1052 | if (this.match(',')) { |
| 1053 | const expressions: Node.Expression[] = []; |
| 1054 | |
| 1055 | this.context.isAssignmentTarget = false; |
| 1056 | expressions.push(expr); |
| 1057 | while (this.lookahead.type !== Token.EOF) { |
| 1058 | if (!this.match(',')) { |
| 1059 | break; |
| 1060 | } |
| 1061 | this.nextToken(); |
| 1062 | if (this.match(')')) { |
| 1063 | this.nextToken(); |
| 1064 | for (let i = 0; i < expressions.length; i++) { |
| 1065 | this.reinterpretExpressionAsPattern(expressions[i]); |
| 1066 | } |
| 1067 | arrow = true; |
| 1068 | expr = { |
| 1069 | type: ArrowParameterPlaceHolder, |
| 1070 | params: expressions, |
| 1071 | async: false |
| 1072 | }; |
| 1073 | } else if (this.match('...')) { |
| 1074 | if (!this.context.isBindingElement) { |
| 1075 | this.throwUnexpectedToken(this.lookahead); |
| 1076 | } |
nothing calls this directly
no test coverage detected