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

Function isConstContext

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

Source from the content-addressed store, hash-verified

79601 return false;
79602 }
79603 function isConstContext(node) {
79604 var parent = node.parent;
79605 return ts.isAssertionExpression(parent) && ts.isConstTypeReference(parent.type) ||
79606 ts.isJSDocTypeAssertion(parent) && ts.isConstTypeReference(ts.getJSDocTypeAssertionType(parent)) ||
79607 (ts.isParenthesizedExpression(parent) || ts.isArrayLiteralExpression(parent) || ts.isSpreadElement(parent)) && isConstContext(parent) ||
79608 (ts.isPropertyAssignment(parent) || ts.isShorthandPropertyAssignment(parent) || ts.isTemplateSpan(parent)) && isConstContext(parent.parent);
79609 }
79610 function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) {
79611 var type = checkExpression(node, checkMode, forceTuple);
79612 return isConstContext(node) || ts.isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) :

Callers 5

checkArrayLiteralFunction · 0.85
checkObjectLiteralFunction · 0.85
checkTemplateExpressionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…