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

Function checkImportMetaProperty

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

Source from the content-addressed store, hash-verified

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) {
77455 error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
77456 }
77457 }
77458 else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
77459 error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
77460 }
77461 var file = ts.getSourceFileOfNode(node);
77462 ts.Debug.assert(!!(file.flags & 4194304 /* NodeFlags.PossiblyContainsImportMeta */), "Containing file is missing import meta node flag.");
77463 return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
77464 }
77465 function getTypeOfParameter(symbol) {
77466 var type = getTypeOfSymbol(symbol);
77467 if (strictNullChecks) {

Callers 1

checkMetaPropertyFunction · 0.85

Calls 3

getGlobalImportMetaTypeFunction · 0.85
assertMethod · 0.80
errorFunction · 0.70

Tested by

no test coverage detected