Skip to content

Commit 81cf3d4

Browse files
committed
JS: Use Class#getAnInstanceReference
1 parent 2a67085 commit 81cf3d4

File tree

1 file changed

+6
-7
lines changed
  • javascript/ql/lib/semmle/javascript

1 file changed

+6
-7
lines changed

javascript/ql/lib/semmle/javascript/DOM.qll

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,6 @@ module DOM {
420420
t.startInProp("target") and
421421
result = domEventSource()
422422
or
423-
t.start() and
424-
exists(DataFlow::ClassNode cls |
425-
cls.getASuperClassNode().getALocalSource() =
426-
DataFlow::globalVarRef(any(string s | s.matches("HTML%Element"))) and
427-
result = cls.getAReceiverNode()
428-
)
429-
or
430423
exists(DataFlow::TypeTracker t2 | result = domValueRef(t2).track(t2, t))
431424
}
432425

@@ -437,6 +430,12 @@ module DOM {
437430
result.hasUnderlyingType("Element")
438431
or
439432
result.hasUnderlyingType(any(string s | s.matches("HTML%Element")))
433+
or
434+
exists(DataFlow::ClassNode cls |
435+
cls.getASuperClassNode().getALocalSource() =
436+
DataFlow::globalVarRef(any(string s | s.matches("HTML%Element"))) and
437+
result = cls.getAnInstanceReference()
438+
)
440439
}
441440

442441
module LocationSource {

0 commit comments

Comments
 (0)