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.
17 lines
250 B
JavaScript
17 lines
250 B
JavaScript
function render(flag) {
|
|
if (flag) {
|
|
var _ret = function () {
|
|
var bar = "bar";
|
|
|
|
[].map(() => bar);
|
|
|
|
return {
|
|
v: <foo bar={bar} />
|
|
};
|
|
}();
|
|
|
|
if (typeof _ret === "object") return _ret.v;
|
|
}
|
|
|
|
return null;
|
|
} |