Skip to content

Commit 7e7899f

Browse files
author
Max Schaefer
committed
JavaScript: Add predicate DataFlow::Node.getTopLevel().
1 parent 3e56e9e commit 7e7899f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ module DataFlow {
8888
/** Gets the container in which this node occurs. */
8989
StmtContainer getContainer() { result = getBasicBlock().getContainer() }
9090

91+
/** Gets the toplevel in which this node occurs. */
92+
TopLevel getTopLevel() { result = getContainer().getTopLevel() }
93+
9194
/**
9295
* Holds if this data flow node accesses the global variable `g`, either directly
9396
* or through the `window` object.

0 commit comments

Comments
 (0)