mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
JS: Add tests before #15823 changes
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
| classes.js:31:28:31:122 | /* use= ... ce() */ | def moduleImport("classes").getMember("exports").getMember("MyThirdStream") has no outgoing edge labelled getInstance(); it does have outgoing edges labelled getReceiver(). |
|
||||
| classes.js:33:37:33:131 | /* use= ... ce() */ | def moduleImport("classes").getMember("exports").getMember("MyThirdStream") has no outgoing edge labelled getInstance(); it does have outgoing edges labelled getReceiver(). |
|
||||
| classes.js:40:28:40:112 | /* use= ... ce() */ | def moduleImport("classes").getMember("exports").getMember("bar") has no outgoing edge labelled getInstance(); it does have outgoing edges labelled getReceiver(). |
|
||||
| classes.js:45:26:45:110 | /* use= ... ce() */ | def moduleImport("classes").getMember("exports").getMember("bar") has no outgoing edge labelled getInstance(); it does have outgoing edges labelled getReceiver(). |
|
||||
|
||||
@@ -25,3 +25,24 @@ MyOtherStream.prototype.instanceProp = 1; /* def=moduleImport("classes").getMemb
|
||||
MyOtherStream.classProp = 1; /* def=moduleImport("classes").getMember("exports").getMember("MyOtherStream").getMember("classProp") */
|
||||
|
||||
module.exports.MyOtherStream = MyOtherStream;
|
||||
|
||||
|
||||
// function-style class without .prototype reference
|
||||
function MyThirdStream() { /* use=moduleImport("classes").getMember("exports").getMember("MyThirdStream").getInstance() */
|
||||
}
|
||||
let instance = new MyThirdStream(); /* use=moduleImport("classes").getMember("exports").getMember("MyThirdStream").getInstance() */
|
||||
|
||||
module.exports.MyThirdStream = MyThirdStream;
|
||||
|
||||
|
||||
// function-style class without .prototype reference (through global variable)
|
||||
(function(f) {
|
||||
foo.bar = function() { /* use=moduleImport("classes").getMember("exports").getMember("bar").getInstance() */
|
||||
}
|
||||
})(foo = foo || {});
|
||||
|
||||
(function(f) {
|
||||
let x = new f.bar(); /* use=moduleImport("classes").getMember("exports").getMember("bar").getInstance() */
|
||||
})(foo = foo || {});
|
||||
|
||||
module.exports.bar = foo.bar;
|
||||
|
||||
Reference in New Issue
Block a user