mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
JS: support property tracking of custom abstract values
This commit is contained in:
@@ -77,5 +77,6 @@ predicate shouldAlwaysTrackProperties(AbstractValue baseVal) {
|
||||
predicate shouldTrackProperties(AbstractValue baseVal) {
|
||||
shouldAlwaysTrackProperties(baseVal) or
|
||||
baseVal instanceof AbstractObjectLiteral or
|
||||
baseVal instanceof AbstractInstance
|
||||
baseVal instanceof AbstractInstance or
|
||||
baseVal.(DefinedCustomAbstractValue).shouldTrackProperties()
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ import semmle.javascript.dataflow.Configuration
|
||||
*/
|
||||
predicate shouldTrackProperties(AbstractValue obj) {
|
||||
obj instanceof AbstractExportsObject or
|
||||
obj instanceof AbstractModuleObject
|
||||
obj instanceof AbstractModuleObject or
|
||||
obj.(DefinedCustomAbstractValue).shouldTrackProperties()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
| tst.js:4:16:4:50 | { custo ... false } | tst.js:4:16:4:50 | { custo ... false } | false | false |
|
||||
| tst.js:5:16:5:49 | { custo ... true } | tst.js:5:16:5:49 | { custo ... true } | false | false |
|
||||
| tst.js:5:16:5:49 | { custo ... true } | tst.js:5:16:5:49 | { custo ... true } | true | true |
|
||||
|
||||
Reference in New Issue
Block a user