mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
JS: add DataFlow::Node.getIntValue()
This commit is contained in:
@@ -108,6 +108,9 @@ module DataFlow {
|
||||
b = analyze().getAValue().(AbstractBoolean).getBooleanValue()
|
||||
}
|
||||
|
||||
/** Gets the integer value of this node, if it is an integer constant. */
|
||||
int getIntValue() { result = asExpr().getIntValue() }
|
||||
|
||||
/**
|
||||
* Holds if this expression may refer to the initial value of parameter `p`.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
| eval.js:2:11:2:12 | 42 | 42 |
|
||||
| sources.js:4:12:4:13 | 19 | 19 |
|
||||
| sources.js:5:4:5:5 | 23 | 23 |
|
||||
| tst.js:3:9:3:10 | 42 | 42 |
|
||||
| tst.js:51:11:51:12 | 42 | 42 |
|
||||
| tst.js:65:9:65:10 | 42 | 42 |
|
||||
| tst.js:69:11:69:12 | 23 | 23 |
|
||||
| tst.js:93:6:93:7 | 19 | 19 |
|
||||
| tst.js:94:6:94:7 | 23 | 23 |
|
||||
| tst.js:95:6:95:6 | 0 | 0 |
|
||||
| tst.js:103:6:103:7 | 19 | 19 |
|
||||
| tst.js:103:10:103:11 | 23 | 23 |
|
||||
| tst.js:103:14:103:14 | 0 | 0 |
|
||||
| tst.ts:2:18:2:19 | 42 | 42 |
|
||||
| tst.ts:8:9:8:10 | 23 | 23 |
|
||||
4
javascript/ql/test/library-tests/DataFlow/getIntValue.ql
Normal file
4
javascript/ql/test/library-tests/DataFlow/getIntValue.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from DataFlow::Node node
|
||||
select node, node.getIntValue()
|
||||
Reference in New Issue
Block a user