Files
react/compiler/crates/react_hermes_parser/tests/fixtures/mutable-liverange-loop.js
2024-04-02 16:49:31 -07:00

30 lines
496 B
JavaScript

function mutate() {}
function cond() {}
function Component(props) {
let a = {};
let b = {};
let c = {};
let d = {};
while (true) {
mutate(a, b);
if (cond(a)) {
break;
}
}
// all of these tests are seemingly readonly, since the values are never directly
// mutated again. but they are all aliased by `d`, which is later modified, and
// these are therefore mutable references:
if (a) {
}
if (b) {
}
if (c) {
}
if (d) {
}
mutate(d, null);
}