mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
27 lines
493 B
TypeScript
27 lines
493 B
TypeScript
//// [tests/cases/conformance/controlFlow/controlFlowForOfStatement.ts] ////
|
|
|
|
//// [controlFlowForOfStatement.ts]
|
|
let obj: number[];
|
|
let x: string | number | boolean | RegExp;
|
|
|
|
function a() {
|
|
x = true;
|
|
for (x of obj) {
|
|
x = x.toExponential();
|
|
}
|
|
x; // string | boolean
|
|
}
|
|
|
|
|
|
//// [controlFlowForOfStatement.js]
|
|
"use strict";
|
|
let obj;
|
|
let x;
|
|
function a() {
|
|
x = true;
|
|
for (x of obj) {
|
|
x = x.toExponential();
|
|
}
|
|
x; // string | boolean
|
|
}
|