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:
parent
ca7f78b8df
commit
79b9fa51b6
16
tests/baselines/reference/yieldExpressionInFlowLoop.js
Normal file
16
tests/baselines/reference/yieldExpressionInFlowLoop.js
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
14
tests/baselines/reference/yieldExpressionInFlowLoop.symbols
Normal file
14
tests/baselines/reference/yieldExpressionInFlowLoop.symbols
Normal file
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
18
tests/baselines/reference/yieldExpressionInFlowLoop.types
Normal file
18
tests/baselines/reference/yieldExpressionInFlowLoop.types
Normal file
|
@ -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
|
||||
}
|
||||
}
|
||||
|
9
tests/cases/compiler/yieldExpressionInFlowLoop.ts
Normal file
9
tests/cases/compiler/yieldExpressionInFlowLoop.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
// @noImplicitAny: true
|
||||
// @target: es6
|
||||
|
||||
function* f() {
|
||||
let result;
|
||||
while (1) {
|
||||
result = yield result;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue