make PathHoister much more flexible, now ignores global references and will not deopt on reassignments and will instead hoist as high as it can, this also fixes #1529 since the order of operations has changed
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
var Foo = React.createClass({
|
||||
render: function render() {
|
||||
return <div foo={notDeclared}></div>;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var _ref = <div foo={notDeclared}></div>;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function render() {
|
||||
return _ref;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
function render(text) {
|
||||
return function () {
|
||||
return <div>{text}</div>;
|
||||
};
|
||||
}
|
||||
|
||||
function render() {
|
||||
return function (text) {
|
||||
return <div>{text}</div>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
function render(text) {
|
||||
var _ref = <div>{text}</div>;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
|
||||
function render() {
|
||||
return function (text) {
|
||||
return <div>{text}</div>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function render(text) {
|
||||
text += "yes";
|
||||
|
||||
return function () {
|
||||
return <div>{text}</div>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
function render(text) {
|
||||
text += "yes";
|
||||
|
||||
var _ref = <div>{text}</div>;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user