Prevent multiple return statements in a loop when replacing expressions (#5030)

This commit is contained in:
Brian Ng
2017-02-09 15:06:41 -06:00
committed by Logan Smyth
parent 1a325ce5d5
commit 6da9bb83df
3 changed files with 32 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
let p
let a = do {
while (p = p.parentPath) {
if (a) {
'a'
} else {
'b'
}
}
};

View File

@@ -0,0 +1,13 @@
let p;
let a = function () {
var _ret;
while (p = p.parentPath) {
if (a) {
_ret = 'a';
} else {
_ret = 'b';
}
}
return _ret;
}();