Files
test-repo/tests/format/js/for/continue-and-break-comment-2.js
T
Sosuke Suzuki db73cc8e0c Print end-of-line comment for continue/break statements (#12075)
* Add handleBreakAndContinueStatementComments to handleEndOfLineComment

* Add tests

* Add changelog

* Update tests

* Add more tests

* Fix for own line comments

* Fix tests

* Fix tests

* Fix tests

* Add unstable tests
2022-01-19 22:29:37 +09:00

146 lines
1.3 KiB
JavaScript

for(;;) {
continue
// comment
;
}
for (;;) {
break
// comment
;
}
for (const f of []) {
continue
// comment
;
}
for (const f of []) {
break
// comment
;
}
for (const f in {}) {
continue
// comment
;
}
for (const f in {}) {
break
// comment
;
}
while(true) {
continue
// comment
;
}
while (true) {
break
// comment
;
}
do {
continue
// comment
;
} while(true);
do {
break
// comment
;
} while(true);
label1: for (;;) {
continue label1
// comment
;
}
label2: {
break label2
// comment
;
};
for(;;) {
continue
/* comment */
;
}
for (;;) {
break
/* comment */
;
}
for (const f of []) {
continue
/* comment */
;
}
for (const f of []) {
break
/* comment */
;
}
for (const f in {}) {
continue
/* comment */
;
}
for (const f in {}) {
break
/* comment */
;
}
while(true) {
continue
/* comment */
;
}
while (true) {
break
/* comment */
;
}
do {
continue
/* comment */
;
} while(true);
do {
break
/* comment */
;
} while(true);
label1: for (;;) {
continue label1
/* comment */
;
}
label2: {
break label2
/* comment */
;
};