Consider yield expressions as having side-effects

See #1043
This commit is contained in:
Richard van Velzen
2016-04-13 14:39:49 +02:00
parent 91cdb93e57
commit eaf3911c31
2 changed files with 31 additions and 3 deletions

View File

@@ -0,0 +1,30 @@
issue_1043: {
options = {
side_effects: true
};
input: {
function* range(start = 0, end = null, step = 1) {
if (end == null) {
end = start;
start = 0;
}
for (let i = start; i < end; i += step) {
yield i;
}
}
}
expect: {
function* range(start = 0, end = null, step = 1) {
if (null == end) {
end = start;
start = 0;
}
for (let i = start; i < end; i += step)
yield i;
}
}
}