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

Function checkModifiers

test/fixtures/snapshot/typescript.js:117861–117888  ·  view source on GitHub ↗
(modifiers, isConstValid)

Source from the content-addressed store, hash-verified

117859 }
117860 }
117861 function checkModifiers(modifiers, isConstValid) {
117862 for (var _i = 0, modifiers_2 = modifiers; _i < modifiers_2.length; _i++) {
117863 var modifier = modifiers_2[_i];
117864 switch (modifier.kind) {
117865 case 85 /* SyntaxKind.ConstKeyword */:
117866 if (isConstValid) {
117867 continue;
117868 }
117869 // to report error,
117870 // falls through
117871 case 123 /* SyntaxKind.PublicKeyword */:
117872 case 121 /* SyntaxKind.PrivateKeyword */:
117873 case 122 /* SyntaxKind.ProtectedKeyword */:
117874 case 145 /* SyntaxKind.ReadonlyKeyword */:
117875 case 135 /* SyntaxKind.DeclareKeyword */:
117876 case 126 /* SyntaxKind.AbstractKeyword */:
117877 case 159 /* SyntaxKind.OverrideKeyword */:
117878 case 101 /* SyntaxKind.InKeyword */:
117879 case 144 /* SyntaxKind.OutKeyword */:
117880 diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, ts.tokenToString(modifier.kind)));
117881 break;
117882 // These are all legal modifiers.
117883 case 124 /* SyntaxKind.StaticKeyword */:
117884 case 93 /* SyntaxKind.ExportKeyword */:
117885 case 88 /* SyntaxKind.DefaultKeyword */:
117886 }
117887 }
117888 }
117889 function createDiagnosticForNodeArray(nodes, message, arg0, arg1, arg2) {
117890 var start = nodes.pos;
117891 return ts.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2);

Callers 1

walkArrayFunction · 0.85

Calls 2

createDiagnosticForNodeFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected