Commit d3a34f3
committed
fix(review): resolve promptTitle race condition
The close event fired synchronously when rl.close() was called inside
the question callback, causing resolve(null) from the close handler to
settle the Promise before resolve(answer) ran — so typed titles were
always discarded.
Drop the close event handler and resolve entirely in the question
callback. On Ctrl-C readline calls the callback with an empty string,
which is coerced to null via `answer || null`.1 parent 363252d commit d3a34f3
1 file changed
+4
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 176 | | |
181 | 177 | | |
182 | 178 | | |
| |||
0 commit comments