stop assigning in while incondition in buffer flush
MODIFY
packages/@romejs/js-generator/Buffer.ts
packages/@romejs/js-generator/Buffer.ts
@@ -203,11 +203,15 @@ export default class Buffer {
}
flush(): void {
- let item;
- while ((item = this._queue.pop())) {
+ while (true) {
+ const item = this._queue.pop();
+ if (item === undefined) {
+ break;
+ } else {
this._append(...item);
}
}
+ }
_append(
str: string,

stop assigning in while incondition in buffer flush