We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6f9e37 commit 504c34eCopy full SHA for 504c34e
javascript/ql/src/semmle/javascript/PrintAst.qll
@@ -74,7 +74,11 @@ private newtype TPrintAstNode =
74
THTMLAttributeNode(HTML::Attribute attr) { shouldPrint(attr, _) and not isNotNeeded(attr) } or
75
THTMLScript(Script script) { shouldPrint(script, _) and not isNotNeeded(script) } or
76
THTMLCodeInAttr(CodeInAttribute attr) { shouldPrint(attr, _) and not isNotNeeded(attr) } or
77
- TRegExpTermNode(RegExpTerm term) { term.isUsedAsRegExp() }
+ TRegExpTermNode(RegExpTerm term) {
78
+ shouldPrint(term, _) and
79
+ term.isUsedAsRegExp() and
80
+ any(RegExpLiteral lit).getRoot() = term.getRootTerm()
81
+ }
82
83
/**
84
* A node in the output tree.
0 commit comments