mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: Add test
This commit is contained in:
@@ -81,6 +81,8 @@ typeInferenceMismatch
|
||||
| exceptions.js:144:9:144:16 | source() | exceptions.js:132:8:132:27 | returnThrownSource() |
|
||||
| exceptions.js:150:13:150:20 | source() | exceptions.js:153:10:153:10 | e |
|
||||
| exceptions.js:158:13:158:20 | source() | exceptions.js:161:10:161:10 | e |
|
||||
| factory-function.js:21:13:21:20 | source() | factory-function.js:7:10:7:12 | obj |
|
||||
| factory-function.js:22:13:22:20 | source() | factory-function.js:7:10:7:12 | obj |
|
||||
| getters-and-setters.js:6:20:6:27 | source() | getters-and-setters.js:9:10:9:18 | new C().x |
|
||||
| getters-and-setters.js:6:20:6:27 | source() | getters-and-setters.js:13:18:13:20 | c.x |
|
||||
| getters-and-setters.js:27:15:27:22 | source() | getters-and-setters.js:23:18:23:18 | v |
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
| exceptions.js:144:9:144:16 | source() | exceptions.js:132:8:132:27 | returnThrownSource() |
|
||||
| exceptions.js:150:13:150:20 | source() | exceptions.js:153:10:153:10 | e |
|
||||
| exceptions.js:158:13:158:20 | source() | exceptions.js:161:10:161:10 | e |
|
||||
| factory-function.js:21:13:21:20 | source() | factory-function.js:7:10:7:12 | obj |
|
||||
| factory-function.js:22:13:22:20 | source() | factory-function.js:7:10:7:12 | obj |
|
||||
| getters-and-setters.js:6:20:6:27 | source() | getters-and-setters.js:9:10:9:18 | new C().x |
|
||||
| getters-and-setters.js:6:20:6:27 | source() | getters-and-setters.js:13:18:13:20 | c.x |
|
||||
| getters-and-setters.js:27:15:27:22 | source() | getters-and-setters.js:23:18:23:18 | v |
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
import * as dummy from 'dummy';
|
||||
|
||||
var objectA = function(){
|
||||
return {};
|
||||
}
|
||||
objectA.set = function (obj){
|
||||
sink(obj);
|
||||
};
|
||||
|
||||
function factory() {
|
||||
var objectB = function(){
|
||||
return {};
|
||||
}
|
||||
|
||||
objectB.set = function (obj){
|
||||
sink(obj); // NOT OK
|
||||
};
|
||||
return objectB;
|
||||
}
|
||||
|
||||
objectA.set(source());
|
||||
objectA.set(source());
|
||||
|
||||
factory();
|
||||
b = factory();
|
||||
b.set(source())
|
||||
b.set(source())
|
||||
Reference in New Issue
Block a user