Skip to content

Commit 4a2472a

Browse files
committed
add hasLocationInfo predicate to regexp terms
1 parent e928777 commit 4a2472a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

javascript/ql/lib/semmle/javascript/Regexp.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ class RegExpTerm extends Locatable, @regexpterm {
176176
* Gets a string that is matched by this regular-expression term.
177177
*/
178178
string getAMatchedString() { result = this.getConstantValue() }
179+
180+
/** Holds if this term has the specified location. */
181+
predicate hasLocationInfo(
182+
string filepath, int startline, int startcolumn, int endline, int endcolumn
183+
) {
184+
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
185+
}
179186
}
180187

181188
/**

0 commit comments

Comments
 (0)