Scott Kyle 5a9509205b Fix constant elements hoisted out of block (#4419)
When block scoped variables caused the block to be wrapped in a closure, the variable `bindings` remained in parent function scope, which caused the JSX element to be hoisted out of the closure.
2016-12-03 19:54:53 -08:00

12 lines
136 B
JavaScript

function render(flag) {
if (flag) {
let bar = "bar";
[].map(() => bar);
return <foo bar={bar} />;
}
return null;
}