(container *ast.Node, targetLabel *ast.Node)
| 1367 | } |
| 1368 | |
| 1369 | func getLabelReferencesInNode(container *ast.Node, targetLabel *ast.Node) []*SymbolAndEntries { |
| 1370 | sourceFile := ast.GetSourceFileOfNode(container) |
| 1371 | labelName := targetLabel.Text() |
| 1372 | references := core.MapNonNil(getPossibleSymbolReferenceNodes(sourceFile, labelName, container), func(node *ast.Node) *ReferenceEntry { |
| 1373 | // Only pick labels that are either the target label, or have a target that is the target label |
| 1374 | if node == targetLabel.AsNode() || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) == targetLabel) { |
| 1375 | return newNodeEntry(node) |
| 1376 | } |
| 1377 | return nil |
| 1378 | }) |
| 1379 | return []*SymbolAndEntries{NewSymbolAndEntries(definitionKindLabel, targetLabel, nil, references)} |
| 1380 | } |
| 1381 | |
| 1382 | func getReferencesForThisKeyword(thisOrSuperKeyword *ast.Node, sourceFiles []*ast.SourceFile) []*SymbolAndEntries { |
| 1383 | searchSpaceNode := ast.GetThisContainer(thisOrSuperKeyword, false /*includeArrowFunctions*/, false /*includeClassComputedPropertyName*/) |
no test coverage detected