mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: Add a new test
This commit is contained in:
15
javascript/ql/test/library-tests/CallGraphs/protoclass.js
Normal file
15
javascript/ql/test/library-tests/CallGraphs/protoclass.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import * as dummy from 'dummy';
|
||||
|
||||
function F() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
F.prototype.init = function() {
|
||||
this.method();
|
||||
let m = this.method.bind(this);
|
||||
m();
|
||||
};
|
||||
|
||||
F.prototype.method = function() {};
|
||||
|
||||
export default F;
|
||||
@@ -12,6 +12,10 @@ test_isUncertain
|
||||
| n.js:2:1:2:5 | m.f() |
|
||||
| n.js:4:10:4:24 | require('./m2') |
|
||||
| n.js:5:1:5:6 | m2.f() |
|
||||
| protoclass.js:4:3:4:13 | this.init() |
|
||||
| protoclass.js:8:3:8:15 | this.method() |
|
||||
| protoclass.js:9:11:9:32 | this.me ... d(this) |
|
||||
| protoclass.js:10:3:10:5 | m() |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) |
|
||||
| reflection.js:8:1:8:25 | add.app ... 3, 19]) |
|
||||
| tst.js:6:1:6:3 | f() |
|
||||
@@ -86,6 +90,15 @@ test_getAFunctionValue
|
||||
| m.js:3:1:3:16 | module.exports.f | m.js:1:13:1:25 | function() {} |
|
||||
| n.js:2:1:2:3 | m.f | m.js:1:13:1:25 | function() {} |
|
||||
| n.js:5:1:5:4 | m2.f | m2.js:2:6:2:18 | function() {} |
|
||||
| protoclass.js:3:1:5:1 | functio ... it();\\n} | protoclass.js:3:1:5:1 | functio ... it();\\n} |
|
||||
| protoclass.js:3:10:3:10 | F | protoclass.js:3:1:5:1 | functio ... it();\\n} |
|
||||
| protoclass.js:7:1:7:1 | F | protoclass.js:3:1:5:1 | functio ... it();\\n} |
|
||||
| protoclass.js:7:1:11:1 | F.proto ... m();\\n} | protoclass.js:7:20:11:1 | functio ... m();\\n} |
|
||||
| protoclass.js:7:20:11:1 | functio ... m();\\n} | protoclass.js:7:20:11:1 | functio ... m();\\n} |
|
||||
| protoclass.js:13:1:13:1 | F | protoclass.js:3:1:5:1 | functio ... it();\\n} |
|
||||
| protoclass.js:13:1:13:34 | F.proto ... on() {} | protoclass.js:13:22:13:34 | function() {} |
|
||||
| protoclass.js:13:22:13:34 | function() {} | protoclass.js:13:22:13:34 | function() {} |
|
||||
| protoclass.js:15:16:15:16 | F | protoclass.js:3:1:5:1 | functio ... it();\\n} |
|
||||
| reflection.js:1:1:3:1 | functio ... x+y;\\n} | reflection.js:1:1:3:1 | functio ... x+y;\\n} |
|
||||
| reflection.js:5:3:5:5 | add | reflection.js:1:1:3:1 | functio ... x+y;\\n} |
|
||||
| reflection.js:5:3:5:39 | add.app ... n 56; } | reflection.js:5:15:5:39 | functio ... n 56; } |
|
||||
@@ -176,6 +189,7 @@ test_getArgument
|
||||
| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | 0 | es2015.js:36:5:36:5 | 1 |
|
||||
| n.js:1:9:1:22 | require('./m') | 0 | n.js:1:17:1:21 | './m' |
|
||||
| n.js:4:10:4:24 | require('./m2') | 0 | n.js:4:18:4:23 | './m2' |
|
||||
| protoclass.js:9:11:9:32 | this.me ... d(this) | 0 | protoclass.js:9:28:9:31 | this |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 0 | reflection.js:7:10:7:13 | null |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 1 | reflection.js:7:16:7:17 | 23 |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 2 | reflection.js:7:20:7:21 | 19 |
|
||||
@@ -207,6 +221,10 @@ test_getNumArgument
|
||||
| n.js:2:1:2:5 | m.f() | 0 |
|
||||
| n.js:4:10:4:24 | require('./m2') | 1 |
|
||||
| n.js:5:1:5:6 | m2.f() | 0 |
|
||||
| protoclass.js:4:3:4:13 | this.init() | 0 |
|
||||
| protoclass.js:8:3:8:15 | this.method() | 0 |
|
||||
| protoclass.js:9:11:9:32 | this.me ... d(this) | 1 |
|
||||
| protoclass.js:10:3:10:5 | m() | 0 |
|
||||
| reflection.js:4:5:4:12 | sneaky() | 0 |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 3 |
|
||||
| reflection.js:7:1:7:22 | reflective call | 2 |
|
||||
@@ -252,6 +270,10 @@ test_isIncomplete
|
||||
| n.js:2:1:2:5 | m.f() |
|
||||
| n.js:4:10:4:24 | require('./m2') |
|
||||
| n.js:5:1:5:6 | m2.f() |
|
||||
| protoclass.js:4:3:4:13 | this.init() |
|
||||
| protoclass.js:8:3:8:15 | this.method() |
|
||||
| protoclass.js:9:11:9:32 | this.me ... d(this) |
|
||||
| protoclass.js:10:3:10:5 | m() |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) |
|
||||
| reflection.js:8:1:8:25 | add.app ... 3, 19]) |
|
||||
| tst.js:6:1:6:3 | f() |
|
||||
@@ -295,6 +317,10 @@ test_getCalleeNode
|
||||
| n.js:2:1:2:5 | m.f() | n.js:2:1:2:3 | m.f |
|
||||
| n.js:4:10:4:24 | require('./m2') | n.js:4:10:4:16 | require |
|
||||
| n.js:5:1:5:6 | m2.f() | n.js:5:1:5:4 | m2.f |
|
||||
| protoclass.js:4:3:4:13 | this.init() | protoclass.js:4:3:4:11 | this.init |
|
||||
| protoclass.js:8:3:8:15 | this.method() | protoclass.js:8:3:8:13 | this.method |
|
||||
| protoclass.js:9:11:9:32 | this.me ... d(this) | protoclass.js:9:11:9:26 | this.method.bind |
|
||||
| protoclass.js:10:3:10:5 | m() | protoclass.js:10:3:10:3 | m |
|
||||
| reflection.js:4:5:4:12 | sneaky() | reflection.js:4:5:4:10 | sneaky |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:1:7:8 | add.call |
|
||||
| reflection.js:7:1:7:22 | reflective call | reflection.js:7:1:7:3 | add |
|
||||
@@ -334,6 +360,7 @@ test_getLastArgument
|
||||
| es2015.js:27:5:27:23 | console.log(this.x) | es2015.js:27:17:27:22 | this.x |
|
||||
| n.js:1:9:1:22 | require('./m') | n.js:1:17:1:21 | './m' |
|
||||
| n.js:4:10:4:24 | require('./m2') | n.js:4:18:4:23 | './m2' |
|
||||
| protoclass.js:9:11:9:32 | this.me ... d(this) | protoclass.js:9:28:9:31 | this |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:20:7:21 | 19 |
|
||||
| reflection.js:7:1:7:22 | reflective call | reflection.js:7:20:7:21 | 19 |
|
||||
| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:8:17:8:24 | [23, 19] |
|
||||
@@ -349,6 +376,7 @@ test_getAnArgument
|
||||
| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | es2015.js:36:16:36:16 | 3 |
|
||||
| n.js:1:9:1:22 | require('./m') | n.js:1:17:1:21 | './m' |
|
||||
| n.js:4:10:4:24 | require('./m2') | n.js:4:18:4:23 | './m2' |
|
||||
| protoclass.js:9:11:9:32 | this.me ... d(this) | protoclass.js:9:28:9:31 | this |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:10:7:13 | null |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:16:7:17 | 23 |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:20:7:21 | 19 |
|
||||
@@ -430,6 +458,10 @@ test_getCalleeName
|
||||
| n.js:2:1:2:5 | m.f() | f |
|
||||
| n.js:4:10:4:24 | require('./m2') | require |
|
||||
| n.js:5:1:5:6 | m2.f() | f |
|
||||
| protoclass.js:4:3:4:13 | this.init() | init |
|
||||
| protoclass.js:8:3:8:15 | this.method() | method |
|
||||
| protoclass.js:9:11:9:32 | this.me ... d(this) | bind |
|
||||
| protoclass.js:10:3:10:5 | m() | m |
|
||||
| reflection.js:4:5:4:12 | sneaky() | sneaky |
|
||||
| reflection.js:7:1:7:22 | add.cal ... 23, 19) | call |
|
||||
| reflection.js:8:1:8:25 | add.app ... 3, 19]) | apply |
|
||||
|
||||
Reference in New Issue
Block a user