Skip to content

Commit 9888f15

Browse files
committed
JS: Add test showing root cause of problem
1 parent 2d864aa commit 9888f15

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

javascript/ql/test/library-tests/Constants/Constants.expected

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
getIntValue
2+
| tst2.ts:1:21:1:21 | 1 | 1 |
3+
| tst.js:6:1:6:1 | 1 | 1 |
4+
| tst.js:11:1:11:2 | -1 | -1 |
5+
| tst.js:11:2:11:2 | 1 | 1 |
6+
| tst.js:12:2:12:2 | 0 | 0 |
7+
| tst.js:26:3:26:3 | 0 | 0 |
8+
| tst.js:29:6:29:6 | 0 | 0 |
9+
| tst.js:35:1:35:1 | 1 | 1 |
10+
| tst.js:35:5:35:5 | 2 | 2 |
11+
| tst.js:35:9:35:9 | 3 | 3 |
12+
| tst.js:37:1:37:3 | (1) | 1 |
13+
| tst.js:37:2:37:2 | 1 | 1 |
14+
| tst.js:39:4:39:4 | 1 | 1 |
15+
| tst.js:40:1:40:1 | 1 | 1 |
16+
| tst.js:42:1:42:1 | 1 | 1 |
17+
| tst.js:42:4:42:4 | 2 | 2 |
18+
| tst.js:42:7:42:7 | 3 | 3 |
19+
| tst.js:43:4:43:4 | 2 | 2 |
20+
| tst.js:43:7:43:7 | 3 | 3 |
21+
| tst.js:44:1:44:1 | 1 | 1 |
22+
| tst.js:44:7:44:7 | 3 | 3 |
23+
| tst.js:45:1:45:1 | 1 | 1 |
24+
| tst.js:45:4:45:4 | 2 | 2 |
25+
| tst.js:47:5:47:5 | 1 | 1 |
26+
| tst.js:48:7:48:7 | 1 | 1 |
27+
| tst.js:49:6:49:6 | 1 | 1 |
28+
| tst.js:52:5:52:9 | 1_000 | 1 |
29+
| tst.js:53:5:53:13 | 1_000_123 | 1 |
30+
#select
131
| tst2.ts:1:13:1:21 | <number>1 |
232
| tst2.ts:1:21:1:21 | 1 |
333
| tst.js:1:1:1:3 | "a" |
@@ -61,3 +91,7 @@
6191
| tst.js:48:1:48:7 | x.p = 1 |
6292
| tst.js:48:7:48:7 | 1 |
6393
| tst.js:49:6:49:6 | 1 |
94+
| tst.js:52:1:52:9 | x = 1_000 |
95+
| tst.js:52:5:52:9 | 1_000 |
96+
| tst.js:53:1:53:13 | x = 1_000_123 |
97+
| tst.js:53:5:53:13 | 1_000_123 |

javascript/ql/test/library-tests/Constants/Constants.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ import javascript
22

33
from ConstantExpr c
44
select c
5+
6+
query int getIntValue(Expr e) { result = e.getIntValue() }

javascript/ql/test/library-tests/Constants/tst.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ x = 1;
4848
x.p = 1;
4949
x += 1;
5050
x += x;
51+
52+
x = 1_000;
53+
x = 1_000_123;

0 commit comments

Comments
 (0)