-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15760 from asgerf/js/summarised-tt-store-steps
JS: Summarise store steps for type tracking
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
javascript/ql/test/library-tests/TypeTracking/summarize.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |