mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
JS: Recognize calls to .item and .namedItem
This commit is contained in:
@@ -340,6 +340,9 @@ module DOM {
|
||||
t.start() and
|
||||
result = domValueSource()
|
||||
or
|
||||
t.start() and
|
||||
result = domValueRef().getAMethodCall(["item", "namedItem"])
|
||||
or
|
||||
exists(DataFlow::TypeTracker t2 | result = domValueRef(t2).track(t2, t))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
test_documentRef
|
||||
| customization.js:2:13:2:31 | customGetDocument() |
|
||||
| nameditems.js:1:1:1:8 | document |
|
||||
test_locationRef
|
||||
| customization.js:3:3:3:14 | doc.location |
|
||||
test_domValueRef
|
||||
| customization.js:4:3:4:28 | doc.get ... 'test') |
|
||||
| nameditems.js:1:1:1:30 | documen ... ('foo') |
|
||||
| nameditems.js:1:1:2:19 | documen ... em('x') |
|
||||
| tst.js:49:3:49:8 | window |
|
||||
| tst.js:50:3:50:8 | window |
|
||||
|
||||
2
javascript/ql/test/library-tests/DOM/nameditems.js
Normal file
2
javascript/ql/test/library-tests/DOM/nameditems.js
Normal file
@@ -0,0 +1,2 @@
|
||||
document.getElementById('foo')
|
||||
.namedItem('x');
|
||||
Reference in New Issue
Block a user