The PathHoister ignored member references on "this", causing it to potentially hoist an expression above its function scope. This patch tells the hoister to watch for "this", and if seen, mark the nearest non-arrow function scope as the upper limit for hoistng. This fixes #4397 and is an alternative to #4787.
17 lines
279 B
JavaScript
17 lines
279 B
JavaScript
var _ref = <span>Sub Component</span>;
|
|
|
|
const els = {
|
|
subComponent: () => _ref
|
|
};
|
|
|
|
var _ref2 = <els.subComponent />;
|
|
|
|
class Component extends React.Component {
|
|
constructor(...args) {
|
|
var _temp;
|
|
|
|
return _temp = super(...args), this.render = () => _ref2, _temp;
|
|
}
|
|
|
|
}
|