- Don't hoist constant elements to the same function as their original paths function parent.
 - Push each violation paths ancestry to the breakOnScopePaths collection to avoid constant hoisting to nested paths.
This commit is contained in:
Sebastian McKenzie
2015-07-08 11:35:34 +01:00
parent ec7c40fbf6
commit af7510adec
6 changed files with 57 additions and 7 deletions

View File

@@ -0,0 +1,9 @@
function render() {
var children = <b></b>;
if (someCondition) {
children = <span></span>;
}
return <div>{children}</div>;
}

View File

@@ -0,0 +1,15 @@
"use strict";
var _ref = <b></b>;
var _ref2 = <span></span>;
function render() {
var children = _ref;
if (someCondition) {
children = _ref2;
}
return <div>{children}</div>;
}

View File

@@ -0,0 +1,7 @@
function renderSome(a, b) {
if (a) {
return <div>{b}</div>
} else {
return <span>{b}</span>
}
}

View File

@@ -0,0 +1,9 @@
"use strict";
function renderSome(a, b) {
if (a) {
return <div>{b}</div>;
} else {
return <span>{b}</span>;
}
}