Remove spaces in for statement heads (#19188)

Co-authored-by: fisker Cheung <lionkay@gmail.com>
This commit is contained in:
Igorandfisker Cheung authored and GitHub committed 2026-05-28 05:28:45 +08:00
1 parent b0df42a38e
commit f4ff697101
10 files changed
+63 -47

No files matched your search

@@ -677,12 +677,12 @@ function try_scope() {
function for_scope_let() {
let a: number = 0;
for (let a = "" /* ok: local to init */; ; ) {}
for (let a = "" /* ok: local to init */; ;) {}
}
function for_scope_var() {
var a: number = 0;
for (var a = "" /* error: string ~> number */; ; ) {}
for (var a = "" /* error: string ~> number */; ;) {}
}
function for_in_scope_let(o: Object) {
@@ -577,7 +577,7 @@ function do_while_post_init(b) {
// local use of annotated var in for is ok
function for_scoped_init(b) {
for (; b; ) {
for (; b;) {
var x: number = 0;
var y: number = x;
}
@@ -586,14 +586,14 @@ function for_scoped_init(b) {
// ...but use before for gives undefined
function for_pre_init(b) {
var y: number = x; // error
for (; b; ) {
for (; b;) {
var x: number = 0;
}
}
// ...and after
function for_post_init(b) {
for (; b; ) {
for (; b;) {
var x: number = 0;
}
var y: number = x; // error
@@ -98,7 +98,7 @@ function try_scope_finally() {
function for_scope() {
let a = "";
let b = "";
for (let a; ; ) {
for (let a; ;) {
a = 0; // doesn't add lower bound to outer a
b = 0;
}
@@ -744,7 +744,7 @@ function def_assign_within_try(b: boolean, obj: Obj) {
}
function def_assign_within_for(b: boolean, obj: Obj) {
for (; b; ) {
for (; b;) {
obj.p = 10; // (obj.p : number)
var x: number = obj.p; // ok by def assign
}