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

Function checkGrammarAsyncModifier

test/fixtures/snapshot/typescript.js:88019–88028  ·  view source on GitHub ↗
(node, asyncModifier)

Source from the content-addressed store, hash-verified

88017 return node.modifiers.length > 1 || node.modifiers[0].kind !== allowedModifier;
88018 }
88019 function checkGrammarAsyncModifier(node, asyncModifier) {
88020 switch (node.kind) {
88021 case 169 /* SyntaxKind.MethodDeclaration */:
88022 case 256 /* SyntaxKind.FunctionDeclaration */:
88023 case 213 /* SyntaxKind.FunctionExpression */:
88024 case 214 /* SyntaxKind.ArrowFunction */:
88025 return false;
88026 }
88027 return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async");
88028 }
88029 function checkGrammarForDisallowedTrailingComma(list, diag) {
88030 if (diag === void 0) { diag = ts.Diagnostics.Trailing_comma_not_allowed; }
88031 if (list && list.hasTrailingComma) {

Callers 1

checkGrammarModifiersFunction · 0.85

Calls 1

grammarErrorOnNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…