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

Function checkLabeledStatement

test/fixtures/snapshot/typescript.js:83742–83758  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

83740 }
83741 }
83742 function checkLabeledStatement(node) {
83743 // Grammar checking
83744 if (!checkGrammarStatementInAmbientContext(node)) {
83745 ts.findAncestor(node.parent, function (current) {
83746 if (ts.isFunctionLike(current)) {
83747 return "quit";
83748 }
83749 if (current.kind === 250 /* SyntaxKind.LabeledStatement */ && current.label.escapedText === node.label.escapedText) {
83750 grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label));
83751 return true;
83752 }
83753 return false;
83754 });
83755 }
83756 // ensure that label is unique
83757 checkSourceElement(node.statement);
83758 }
83759 function checkThrowStatement(node) {
83760 // Grammar checking
83761 if (!checkGrammarStatementInAmbientContext(node)) {

Callers 1

checkSourceElementWorkerFunction · 0.85

Calls 3

grammarErrorOnNodeFunction · 0.85
checkSourceElementFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…