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

Function ensureParameter

test/fixtures/snapshot/typescript.js:108439–108452  ·  view source on GitHub ↗
(p, modifierMask, type)

Source from the content-addressed store, hash-verified

108437 }
108438 }
108439 function ensureParameter(p, modifierMask, type) {
108440 var oldDiag;
108441 if (!suppressNewDiagnosticContexts) {
108442 oldDiag = getSymbolAccessibilityDiagnostic;
108443 getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(p);
108444 }
108445 var newParam = factory.updateParameterDeclaration(p,
108446 /*decorators*/ undefined, maskModifiers(p, modifierMask), p.dotDotDotToken, filterBindingPatternInitializers(p.name), resolver.isOptionalParameter(p) ? (p.questionToken || factory.createToken(57 /* SyntaxKind.QuestionToken */)) : undefined, ensureType(p, type || p.type, /*ignorePrivate*/ true), // Ignore private param props, since this type is going straight back into a param
108447 ensureNoInitializer(p));
108448 if (!suppressNewDiagnosticContexts) {
108449 getSymbolAccessibilityDiagnostic = oldDiag;
108450 }
108451 return newParam;
108452 }
108453 function shouldPrintWithInitializer(node) {
108454 return canHaveLiteralInitializer(node) && resolver.isLiteralConstDeclaration(ts.getParseTreeNode(node)); // TODO: Make safe
108455 }

Callers 2

updateParamsListFunction · 0.85
updateAccessorParamsListFunction · 0.85

Calls 4

maskModifiersFunction · 0.85
ensureTypeFunction · 0.85
ensureNoInitializerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…