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

Function checkThisBeforeSuper

test/fixtures/snapshot/typescript.js:71924–71934  ·  view source on GitHub ↗
(node, container, diagnosticMessage)

Source from the content-addressed store, hash-verified

71922 return baseConstructorType === nullWideningType;
71923 }
71924 function checkThisBeforeSuper(node, container, diagnosticMessage) {
71925 var containingClassDecl = container.parent;
71926 var baseTypeNode = ts.getClassExtendsHeritageElement(containingClassDecl);
71927 // If a containing class does not have extends clause or the class extends null
71928 // skip checking whether super statement is called before "this" accessing.
71929 if (baseTypeNode && !classDeclarationExtendsNull(containingClassDecl)) {
71930 if (node.flowNode && !isPostSuperFlowNode(node.flowNode, /*noCacheCheck*/ false)) {
71931 error(node, diagnosticMessage);
71932 }
71933 }
71934 }
71935 function checkThisInStaticClassFieldInitializerInDecoratedClass(thisExpression, container) {
71936 if (ts.isPropertyDeclaration(container) && ts.hasStaticModifier(container) &&
71937 container.initializer && ts.textRangeContainsPositionInclusive(container.initializer, thisExpression.pos) && ts.length(container.parent.decorators)) {

Callers 2

checkThisExpressionFunction · 0.85
checkSuperExpressionFunction · 0.85

Calls 3

isPostSuperFlowNodeFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected