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

Function checkGrammarInterfaceDeclaration

test/fixtures/snapshot/typescript.js:88230–88250  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

88228 }
88229 }
88230 function checkGrammarInterfaceDeclaration(node) {
88231 var seenExtendsClause = false;
88232 if (node.heritageClauses) {
88233 for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) {
88234 var heritageClause = _a[_i];
88235 if (heritageClause.token === 94 /* SyntaxKind.ExtendsKeyword */) {
88236 if (seenExtendsClause) {
88237 return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen);
88238 }
88239 seenExtendsClause = true;
88240 }
88241 else {
88242 ts.Debug.assert(heritageClause.token === 117 /* SyntaxKind.ImplementsKeyword */);
88243 return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause);
88244 }
88245 // Grammar checking heritageClause inside class declaration
88246 checkGrammarHeritageClause(heritageClause);
88247 }
88248 }
88249 return false;
88250 }
88251 function checkGrammarComputedPropertyName(node) {
88252 // If node is not a computedPropertyName, just skip the grammar checking
88253 if (node.kind !== 162 /* SyntaxKind.ComputedPropertyName */) {

Callers 1

Calls 3

grammarErrorOnFirstTokenFunction · 0.85
assertMethod · 0.80

Tested by

no test coverage detected