MCPcopy Index your code
hub / github.com/nodejs/node / isUpdateExpression

Function isUpdateExpression

test/fixtures/snapshot/typescript.js:35016–35039  ·  view source on GitHub ↗

* Check if the current token can possibly be an ES7 increment expression. * * ES7 UpdateExpression: * LeftHandSideExpression[?Yield] * LeftHandSideExpression[?Yield][no LineTerminator here]++ * LeftHandSideExpression[?Yield][no LineTerminat

()

Source from the content-addressed store, hash-verified

35014 * --LeftHandSideExpression[?Yield]
35015 */
35016 function isUpdateExpression() {
35017 // This function is called inside parseUnaryExpression to decide
35018 // whether to call parseSimpleUnaryExpression or call parseUpdateExpression directly
35019 switch (token()) {
35020 case 39 /* SyntaxKind.PlusToken */:
35021 case 40 /* SyntaxKind.MinusToken */:
35022 case 54 /* SyntaxKind.TildeToken */:
35023 case 53 /* SyntaxKind.ExclamationToken */:
35024 case 89 /* SyntaxKind.DeleteKeyword */:
35025 case 112 /* SyntaxKind.TypeOfKeyword */:
35026 case 114 /* SyntaxKind.VoidKeyword */:
35027 case 132 /* SyntaxKind.AwaitKeyword */:
35028 return false;
35029 case 29 /* SyntaxKind.LessThanToken */:
35030 // If we are not in JSX context, we are parsing TypeAssertion which is an UnaryExpression
35031 if (languageVariant !== 1 /* LanguageVariant.JSX */) {
35032 return false;
35033 }
35034 // We are in JSX context and the token is part of JSXElement.
35035 // falls through
35036 default:
35037 return true;
35038 }
35039 }
35040 /**
35041 * Parse ES7 UpdateExpression. UpdateExpression is used instead of ES6's PostFixExpression.
35042 *

Callers 1

Calls 1

tokenFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…