()
| 1182 | } |
| 1183 | |
| 1184 | parseNewExpression(): Node.MetaProperty | Node.NewExpression { |
| 1185 | const node = this.createNode(); |
| 1186 | |
| 1187 | const id = this.parseIdentifierName(); |
| 1188 | assert(id.name === 'new', 'New expression must start with `new`'); |
| 1189 | |
| 1190 | let expr; |
| 1191 | if (this.match('.')) { |
| 1192 | this.nextToken(); |
| 1193 | if (this.lookahead.type === Token.Identifier && this.context.inFunctionBody && this.lookahead.value === 'target') { |
| 1194 | const property = this.parseIdentifierName(); |
| 1195 | expr = new Node.MetaProperty(id, property); |
| 1196 | } else { |
| 1197 | this.throwUnexpectedToken(this.lookahead); |
| 1198 | } |
| 1199 | } else { |
| 1200 | const callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); |
| 1201 | const args = this.match('(') ? this.parseArguments() : []; |
| 1202 | expr = new Node.NewExpression(callee, args); |
| 1203 | this.context.isAssignmentTarget = false; |
| 1204 | this.context.isBindingElement = false; |
| 1205 | } |
| 1206 | |
| 1207 | return this.finalize(node, expr); |
| 1208 | } |
| 1209 | |
| 1210 | parseAsyncArgument() { |
| 1211 | const arg = this.parseAssignmentExpression(); |
nothing calls this directly
no test coverage detected