mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Merge pull request #15760 from asgerf/js/summarised-tt-store-steps
JS: Summarise store steps for type tracking
This commit is contained in:
41
javascript/ql/test/library-tests/TypeTracking/summarize.js
Normal file
41
javascript/ql/test/library-tests/TypeTracking/summarize.js
Normal 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
|
||||
Reference in New Issue
Block a user