Skip to content

Commit ced1d21

Browse files
committed
JS: Add getters for DeclarationSpace members
1 parent 039a7ba commit ced1d21

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

javascript/ql/lib/semmle/javascript/Variables.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,18 @@ class DeclarationSpace extends string {
873873
DeclarationSpace() { this = "variable" or this = "type" or this = "namespace" }
874874
}
875875

876+
/** Module containing the `DeclarationSpace` constants. */
877+
module DeclarationSpace {
878+
/** Gets the declaration space for variables/values. */
879+
DeclarationSpace variable() { result = "variable" }
880+
881+
/** Gets the declaration space for types. */
882+
DeclarationSpace type() { result = "type" }
883+
884+
/** Gets the declaration space for namespaces. */
885+
DeclarationSpace namespace() { result = "namespace" }
886+
}
887+
876888
/**
877889
* A name that is declared in a particular scope.
878890
*

0 commit comments

Comments
 (0)