File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
src/semmle/javascript/dataflow
test/library-tests/DataFlow Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,9 @@ module DataFlow {
108108 b = analyze ( ) .getAValue ( ) .( AbstractBoolean ) .getBooleanValue ( )
109109 }
110110
111+ /** Gets the integer value of this node, if it is an integer constant. */
112+ int getIntValue ( ) { result = asExpr ( ) .getIntValue ( ) }
113+
111114 /**
112115 * Holds if this expression may refer to the initial value of parameter `p`.
113116 */
Original file line number Diff line number Diff line change 1+ | eval.js:2:11:2:12 | 42 | 42 |
2+ | sources.js:4:12:4:13 | 19 | 19 |
3+ | sources.js:5:4:5:5 | 23 | 23 |
4+ | tst.js:3:9:3:10 | 42 | 42 |
5+ | tst.js:51:11:51:12 | 42 | 42 |
6+ | tst.js:65:9:65:10 | 42 | 42 |
7+ | tst.js:69:11:69:12 | 23 | 23 |
8+ | tst.js:93:6:93:7 | 19 | 19 |
9+ | tst.js:94:6:94:7 | 23 | 23 |
10+ | tst.js:95:6:95:6 | 0 | 0 |
11+ | tst.js:103:6:103:7 | 19 | 19 |
12+ | tst.js:103:10:103:11 | 23 | 23 |
13+ | tst.js:103:14:103:14 | 0 | 0 |
14+ | tst.ts:2:18:2:19 | 42 | 42 |
15+ | tst.ts:8:9:8:10 | 23 | 23 |
Original file line number Diff line number Diff line change 1+ import javascript
2+
3+ from DataFlow:: Node node
4+ select node , node .getIntValue ( )
You can’t perform that action at this time.
0 commit comments