Merge pull request #15760 from asgerf/js/summarised-tt-store-steps

JS: Summarise store steps for type tracking
This commit is contained in:
Asger F
2024-03-08 13:16:25 +01:00
committed by GitHub
2 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import 'dummy';
function identity(x) {
return x;
}
function load(x) {
return x.loadProp;
}
function store(x) {
return { storeProp: x };
}
function loadStore(x) {
return { storeProp: x.loadProp };
}
function loadStore2(x) {
let mid = x.loadProp;
return { storeProp: mid };
}
identity({});
load({});
store({});
loadStore({});
loadStore2({});
const obj = {}; // name: obj
let x = identity(obj);
x; // track: obj
x = load({ loadProp: obj });
x; // track: obj
x = store(obj);
x.storeProp; // track: obj
x = loadStore({ loadProp: obj });
x.storeProp; // track: obj
x = loadStore2({ loadProp: obj });
x.storeProp; // track: obj