mirror of
https://github.com/facebook/react.git
synced 2026-02-26 18:58:05 +00:00
35 lines
560 B
JavaScript
35 lines
560 B
JavaScript
function mutate(x, y) {}
|
|
function cond(x) {}
|
|
|
|
function Component(props) {
|
|
let a = {};
|
|
let b = {};
|
|
let c = {};
|
|
let d = {};
|
|
while (true) {
|
|
let z = a;
|
|
a = b;
|
|
b = c;
|
|
c = d;
|
|
d = z;
|
|
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);
|
|
}
|