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

Function checkNewTargetMetaProperty

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

Source from the content-addressed store, hash-verified

77435 }
77436 }
77437 function checkNewTargetMetaProperty(node) {
77438 var container = ts.getNewTargetContainer(node);
77439 if (!container) {
77440 error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target");
77441 return errorType;
77442 }
77443 else if (container.kind === 171 /* SyntaxKind.Constructor */) {
77444 var symbol = getSymbolOfNode(container.parent);
77445 return getTypeOfSymbol(symbol);
77446 }
77447 else {
77448 var symbol = getSymbolOfNode(container);
77449 return getTypeOfSymbol(symbol);
77450 }
77451 }
77452 function checkImportMetaProperty(node) {
77453 if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
77454 if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {

Callers 3

checkMetaPropertyFunction · 0.85
checkMetaPropertyKeywordFunction · 0.85
getSymbolAtLocationFunction · 0.85

Calls 3

getSymbolOfNodeFunction · 0.85
getTypeOfSymbolFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…