Avoid infinite loop checking yield expression (#21728)

* Avoid infinite loop checking yield expression

* Revert now-unneeded change

* Revert test filename changes
This commit is contained in:
Andy authored and Nathan Shively-Sanders committed 2018-11-19 11:18:32 -08:00
1 parent ca7f78b8df
commit 79b9fa51b6
4 files changed
+57

No files matched your search

@@ -0,0 +1,16 @@
//// [yieldExpressionInFlowLoop.ts]
function* f() {
let result;
while (1) {
result = yield result;
}
}
//// [yieldExpressionInFlowLoop.js]
function* f() {
let result;
while (1) {
result = yield result;
}
}
@@ -0,0 +1,14 @@
=== tests/cases/compiler/yieldExpressionInFlowLoop.ts ===
function* f() {
>f : Symbol(f, Decl(yieldExpressionInFlowLoop.ts, 0, 0))
let result;
>result : Symbol(result, Decl(yieldExpressionInFlowLoop.ts, 1, 7))
while (1) {
result = yield result;
>result : Symbol(result, Decl(yieldExpressionInFlowLoop.ts, 1, 7))
>result : Symbol(result, Decl(yieldExpressionInFlowLoop.ts, 1, 7))
}
}
@@ -0,0 +1,18 @@
=== tests/cases/compiler/yieldExpressionInFlowLoop.ts ===
function* f() {
>f : () => IterableIterator<any>
let result;
>result : any
while (1) {
>1 : 1
result = yield result;
>result = yield result : any
>result : any
>yield result : any
>result : any
}
}
@@ -0,0 +1,9 @@
// @noImplicitAny: true
// @target: es6
function* f() {
let result;
while (1) {
result = yield result;
}
}