Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/lambda-reassign-shadowed-primitive.expect.md
T

59 lines
759 B
Markdown
Raw Normal View History

2026-08-27 21:09:14 +00:00
## Input
```javascript
function Component() {
const x = {};
{
let x = 56;
const fn = function () {
x = 42;
};
fn();
}
return x; // should return {}
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [],
isComponent: false,
};
```
## Code
```javascript
import { c as _c } from "react/compiler-runtime";
function Component() {
const $ = _c(1);
let t0;
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
t0 = {};
$[0] = t0;
} else {
t0 = $[0];
}
const x = t0;
let x_0 = 56;
const fn = function () {
x_0 = 42;
};
fn();
return x;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [],
isComponent: false,
};
```
### Eval output
(kind: ok) {}