MCPcopy
hub / github.com/jquery/esprima / parseUnaryExpression

Method parseUnaryExpression

src/parser.ts:1399–1420  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1397 }
1398
1399 parseUnaryExpression(): Node.Expression {
1400 let expr;
1401
1402 if (this.match('+') || this.match('-') || this.match('~') || this.match('!') ||
1403 this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) {
1404 const node = this.startNode(this.lookahead);
1405 const token = this.nextToken();
1406 expr = this.inheritCoverGrammar(this.parseUnaryExpression);
1407 expr = this.finalize(node, new Node.UnaryExpression(token.value, expr));
1408 if (this.context.strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {
1409 this.tolerateError(Messages.StrictDelete);
1410 }
1411 this.context.isAssignmentTarget = false;
1412 this.context.isBindingElement = false;
1413 } else if (this.context.await && this.matchContextualKeyword('await')) {
1414 expr = this.parseAwaitExpression();
1415 } else {
1416 expr = this.parseUpdateExpression();
1417 }
1418
1419 return expr;
1420 }
1421
1422 parseExponentiationExpression(): Node.Expression {
1423 const startToken = this.lookahead;

Callers 1

parseAwaitExpressionMethod · 0.95

Calls 10

matchMethod · 0.95
matchKeywordMethod · 0.95
startNodeMethod · 0.95
nextTokenMethod · 0.95
inheritCoverGrammarMethod · 0.95
finalizeMethod · 0.95
tolerateErrorMethod · 0.95
parseAwaitExpressionMethod · 0.95
parseUpdateExpressionMethod · 0.95

Tested by

no test coverage detected