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

Function resolveBaseTypesOfInterface

test/fixtures/snapshot/typescript.js:57284–57315  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

57282 type.flags & 2097152 /* TypeFlags.Intersection */ && ts.every(type.types, isValidBaseType));
57283 }
57284 function resolveBaseTypesOfInterface(type) {
57285 type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray;
57286 if (type.symbol.declarations) {
57287 for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) {
57288 var declaration = _a[_i];
57289 if (declaration.kind === 258 /* SyntaxKind.InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) {
57290 for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
57291 var node = _c[_b];
57292 var baseType = getReducedType(getTypeFromTypeNode(node));
57293 if (!isErrorType(baseType)) {
57294 if (isValidBaseType(baseType)) {
57295 if (type !== baseType && !hasBaseType(baseType, type)) {
57296 if (type.resolvedBaseTypes === ts.emptyArray) {
57297 type.resolvedBaseTypes = [baseType];
57298 }
57299 else {
57300 type.resolvedBaseTypes.push(baseType);
57301 }
57302 }
57303 else {
57304 reportCircularBaseType(declaration, type);
57305 }
57306 }
57307 else {
57308 error(node, ts.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members);
57309 }
57310 }
57311 }
57312 }
57313 }
57314 }
57315 }
57316 /**
57317 * Returns true if the interface given by the symbol is free of "this" references.
57318 *

Callers 1

getBaseTypesFunction · 0.85

Calls 8

getReducedTypeFunction · 0.85
getTypeFromTypeNodeFunction · 0.85
isErrorTypeFunction · 0.85
isValidBaseTypeFunction · 0.85
hasBaseTypeFunction · 0.85
reportCircularBaseTypeFunction · 0.85
errorFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…