JS: Add test

This commit is contained in:
Asger Feldthaus
2021-12-06 19:08:06 +01:00
parent 9ffa236c51
commit 4ef2a5f4f1
3 changed files with 31 additions and 0 deletions

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -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())