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

Function getBreakOrContinueOwner

test/fixtures/snapshot/typescript.js:135694–135714  ·  view source on GitHub ↗
(statement)

Source from the content-addressed store, hash-verified

135692 return !!actualOwner && actualOwner === owner;
135693 }
135694 function getBreakOrContinueOwner(statement) {
135695 return ts.findAncestor(statement, function (node) {
135696 switch (node.kind) {
135697 case 249 /* SyntaxKind.SwitchStatement */:
135698 if (statement.kind === 245 /* SyntaxKind.ContinueStatement */) {
135699 return false;
135700 }
135701 // falls through
135702 case 242 /* SyntaxKind.ForStatement */:
135703 case 243 /* SyntaxKind.ForInStatement */:
135704 case 244 /* SyntaxKind.ForOfStatement */:
135705 case 241 /* SyntaxKind.WhileStatement */:
135706 case 240 /* SyntaxKind.DoStatement */:
135707 return !statement.label || isLabeledBy(node, statement.label.escapedText);
135708 default:
135709 // Don't cross function boundaries.
135710 // TODO: GH#20090
135711 return ts.isFunctionLike(node) && "quit";
135712 }
135713 });
135714 }
135715 function getModifierOccurrences(modifier, declaration) {
135716 return ts.mapDefined(getNodesToSearchForModifier(declaration, ts.modifierToFlag(modifier)), function (node) { return ts.findModifier(node, modifier); });
135717 }

Calls 1

isLabeledByFunction · 0.85

Tested by

no test coverage detected