JS: support property tracking of custom abstract values

This commit is contained in:
Esben Sparre Andreasen
2018-11-13 11:29:35 +01:00
parent 1d87c580b3
commit daed0653cb
3 changed files with 5 additions and 3 deletions

View File

@@ -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()
}

View File

@@ -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()
}
/**

View File

@@ -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 |