From 7e7899fabae34870ebce8cfa910bdbe43989871e Mon Sep 17 00:00:00 2001 From: Max Schaefer Date: Thu, 19 Jul 2018 12:23:38 +0200 Subject: [PATCH] JavaScript: Add predicate `DataFlow::Node.getTopLevel()`. --- javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll | 3 +++ 1 file changed, 3 insertions(+) diff --git a/javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll b/javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll index ca559766ac6..d678e5774dd 100644 --- a/javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll +++ b/javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll @@ -88,6 +88,9 @@ module DataFlow { /** Gets the container in which this node occurs. */ StmtContainer getContainer() { result = getBasicBlock().getContainer() } + /** Gets the toplevel in which this node occurs. */ + TopLevel getTopLevel() { result = getContainer().getTopLevel() } + /** * Holds if this data flow node accesses the global variable `g`, either directly * or through the `window` object.