MCPcopy
hub / github.com/eslint/eslint / onCodePathSegmentLoop

Function onCodePathSegmentLoop

lib/rules/no-this-before-super.js:295–319  ·  view source on GitHub ↗

* Update information of the code path segment when a code path was * looped. * @param {CodePathSegment} fromSegment The code path segment of the * end of a loop. * @param {CodePathSegment} toSegment A code path segment of the head * of a loop. * @returns {void}

(fromSegment, toSegment)

Source from the content-addressed store, hash-verified

293 * @returns {void}
294 */
295 onCodePathSegmentLoop(fromSegment, toSegment) {
296 if (!isInConstructorOfDerivedClass()) {
297 return;
298 }
299
300 // Update information inside of the loop.
301 funcInfo.codePath.traverseSegments(
302 { first: toSegment, last: fromSegment },
303 (segment, controller) => {
304 const info =
305 segInfoMap[segment.id] ?? new SegmentInfo();
306
307 if (info.superCalled) {
308 controller.skip();
309 } else if (
310 segment.prevSegments.length > 0 &&
311 segment.prevSegments.every(isCalled)
312 ) {
313 info.superCalled = true;
314 }
315
316 segInfoMap[segment.id] = info;
317 },
318 );
319 },
320
321 /**
322 * Reports if this is before `super()`.

Callers

nothing calls this directly

Calls 3

traverseSegmentsMethod · 0.65
skipMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…