@@ -75,7 +75,7 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
7575
7676 /** Gets the toplevel syntactic unit to which this element belongs. */
7777 cached
78- TopLevel getTopLevel ( ) { result = getParent ( ) .getTopLevel ( ) }
78+ TopLevel getTopLevel ( ) { ExtendedStaging :: Ast :: ref ( ) and result = getParent ( ) .getTopLevel ( ) }
7979
8080 /**
8181 * Gets the `i`th child node of this node.
@@ -119,7 +119,7 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
119119
120120 /** Gets the parent node of this node, if any. */
121121 cached
122- ASTNode getParent ( ) { this = result .getAChild ( ) }
122+ ASTNode getParent ( ) { ExtendedStaging :: Ast :: ref ( ) and this = result .getAChild ( ) }
123123
124124 /** Gets the first control flow node belonging to this syntactic entity. */
125125 ControlFlowNode getFirstControlFlowNode ( ) { result = this }
@@ -135,6 +135,7 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
135135 */
136136 cached
137137 private predicate isAmbientInternal ( ) {
138+ ExtendedStaging:: Ast:: ref ( ) and
138139 getParent ( ) .isAmbientInternal ( )
139140 or
140141 not isAmbientTopLevel ( getTopLevel ( ) ) and
@@ -186,7 +187,9 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
186187 * Holds if the given file is a `.d.ts` file.
187188 */
188189cached
189- private predicate isAmbientTopLevel ( TopLevel tl ) { tl .getFile ( ) .getBaseName ( ) .matches ( "%.d.ts" ) }
190+ private predicate isAmbientTopLevel ( TopLevel tl ) {
191+ ExtendedStaging:: Ast:: ref ( ) and tl .getFile ( ) .getBaseName ( ) .matches ( "%.d.ts" )
192+ }
190193
191194/**
192195 * A toplevel syntactic unit; that is, a stand-alone script, an inline script
0 commit comments