Skip to content

Commit ae8d382

Browse files
committed
JS: add some tests for this
1 parent be09c17 commit ae8d382

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

javascript/ql/test/library-tests/ThisExpr/ThisExpr_analyzed.expected

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
| module-exports.js:3:1:3:4 | this | file://:0:0:0:0 | indefinite value (call) |
2+
| module-exports.js:4:28:4:31 | this | file://:0:0:0:0 | indefinite value (call) |
3+
| module-exports.js:4:28:4:31 | this | module-exports.js:1:1:8:0 | exports object of module module-exports |
4+
| module-exports.js:4:28:4:31 | this | module-exports.js:4:15:4:34 | instance of anonymous function |
5+
| module-exports.js:5:35:5:38 | this | file://:0:0:0:0 | indefinite value (call) |
6+
| module-exports.js:5:35:5:38 | this | file://:0:0:0:0 | indefinite value (heap) |
7+
| module-exports.js:5:35:5:38 | this | module-exports.js:1:1:8:0 | exports object of module module-exports |
8+
| module-exports.js:5:35:5:38 | this | module-exports.js:5:22:5:41 | instance of anonymous function |
9+
| module-exports.js:6:21:6:24 | this | file://:0:0:0:0 | indefinite value (call) |
10+
| module-exports.js:7:28:7:31 | this | file://:0:0:0:0 | indefinite value (call) |
111
| tst.js:4:9:4:12 | this | file://:0:0:0:0 | indefinite value (call) |
212
| tst.js:4:9:4:12 | this | tst.js:1:1:11:1 | instance of class C_normal |
313
| tst.js:8:15:8:18 | this | file://:0:0:0:0 | indefinite value (call) |

javascript/ql/test/library-tests/ThisExpr/getBasicBlock.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
missingBasicBlock
22
basicBlock
3+
| module-exports.js:1:1:1:0 | this | module-exports.js:1:1:1:0 | entry node of <toplevel> |
4+
| module-exports.js:4:15:4:14 | this | module-exports.js:4:15:4:14 | entry node of function() { this; } |
5+
| module-exports.js:5:22:5:21 | this | module-exports.js:5:22:5:21 | entry node of function() { this; } |
36
| tst.js:1:1:1:0 | this | tst.js:1:1:1:0 | entry node of <toplevel> |
47
| tst.js:1:16:1:15 | this | tst.js:1:16:1:15 | entry node of () {} |
58
| tst.js:3:7:3:6 | this | tst.js:3:7:3:6 | entry node of () {\\n ... ;\\n } |

javascript/ql/test/library-tests/ThisExpr/getBinder.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
| module-exports.js:4:28:4:31 | this | module-exports.js:4:15:4:34 | function() { this; } |
2+
| module-exports.js:5:35:5:38 | this | module-exports.js:5:22:5:41 | function() { this; } |
13
| tst.js:4:9:4:12 | this | tst.js:3:7:5:5 | () {\\n ... ;\\n } |
24
| tst.js:8:15:8:18 | this | tst.js:7:7:9:5 | () {\\n ... ;\\n } |
35
| tst.js:17:13:17:16 | this | tst.js:16:10:18:9 | functio ... } |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var fs = require('fs');
2+
3+
this;
4+
exports.foo = function() { this; };
5+
module.exports.bar = function() { this; };
6+
exports.baz = () => this;
7+
module.exports.qux = () => this;

0 commit comments

Comments
 (0)