File tree Expand file tree Collapse file tree
unified/ql/lib/codeql/unified/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,16 @@ module Unified {
4242 )
4343 }
4444
45- /** Gets the nearest callable containing this AST node. */
45+ /**
46+ * Gets the nearest callable containing this AST node.
47+ *
48+ * If this node is itself a callable, this gets the outer callable, not the node itself.
49+ *
50+ * Note that the `TopLevel` is callable, so all nodes other than the `TopLevel` itself has an enclosing callable.
51+ *
52+ * In some cases this predicate skips overs the syntactically-enclosing callable in order to get the callable in which
53+ * the AST is actually evaluated (such as for capture declarations in a function expression).
54+ */
4655 Callable getEnclosingCallable ( ) {
4756 exists ( AstNode parent |
4857 parent = this .overrideEnclosingCallableParent ( )
You can’t perform that action at this time.
0 commit comments