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

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