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

Function isPropertyDeclaredInAncestorClass

test/fixtures/snapshot/typescript.js:74856–74871  ·  view source on GitHub ↗

* It's possible that "prop.valueDeclaration" is a local declaration, but the property was also declared in a superclass. * In that case we won't consider it used before its declaration, because it gets its value from the superclass' declaration.

(prop)

Source from the content-addressed store, hash-verified

74854 * In that case we won't consider it used before its declaration, because it gets its value from the superclass' declaration.
74855 */
74856 function isPropertyDeclaredInAncestorClass(prop) {
74857 if (!(prop.parent.flags & 32 /* SymbolFlags.Class */)) {
74858 return false;
74859 }
74860 var classType = getTypeOfSymbol(prop.parent);
74861 while (true) {
74862 classType = classType.symbol && getSuperClass(classType);
74863 if (!classType) {
74864 return false;
74865 }
74866 var superProperty = getPropertyOfType(classType, prop.escapedName);
74867 if (superProperty && superProperty.valueDeclaration) {
74868 return true;
74869 }
74870 }
74871 }
74872 function getSuperClass(classType) {
74873 var x = getBaseTypes(classType);
74874 if (x.length === 0) {

Callers 1

Calls 3

getTypeOfSymbolFunction · 0.85
getSuperClassFunction · 0.85
getPropertyOfTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…