MCPcopy Create free account
hub / github.com/nodejs/node / traceUnionsOrIntersectionsTooLarge

Function traceUnionsOrIntersectionsTooLarge

test/fixtures/snapshot/typescript.js:65143–65167  ·  view source on GitHub ↗
(source, target)

Source from the content-addressed store, hash-verified

65141 reportRelationError(headMessage, source, target);
65142 }
65143 function traceUnionsOrIntersectionsTooLarge(source, target) {
65144 if (!ts.tracing) {
65145 return;
65146 }
65147 if ((source.flags & 3145728 /* TypeFlags.UnionOrIntersection */) && (target.flags & 3145728 /* TypeFlags.UnionOrIntersection */)) {
65148 var sourceUnionOrIntersection = source;
65149 var targetUnionOrIntersection = target;
65150 if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 32768 /* ObjectFlags.PrimitiveUnion */) {
65151 // There's a fast path for comparing primitive unions
65152 return;
65153 }
65154 var sourceSize = sourceUnionOrIntersection.types.length;
65155 var targetSize = targetUnionOrIntersection.types.length;
65156 if (sourceSize * targetSize > 1E6) {
65157 ts.tracing.instant("checkTypes" /* tracing.Phase.CheckTypes */, "traceUnionsOrIntersectionsTooLarge_DepthLimit", {
65158 sourceId: source.id,
65159 sourceSize: sourceSize,
65160 targetId: target.id,
65161 targetSize: targetSize,
65162 pos: errorNode === null || errorNode === void 0 ? void 0 : errorNode.pos,
65163 end: errorNode === null || errorNode === void 0 ? void 0 : errorNode.end
65164 });
65165 }
65166 }
65167 }
65168 function getTypeOfPropertyInTypes(types, name) {
65169 var appendPropType = function (propTypes, type) {
65170 var _a;

Callers 1

isRelatedToFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected