(text, error)
| 338 | } |
| 339 | |
| 340 | function rejectText(text, error) { |
| 341 | const record = textCache.get(text); |
| 342 | if (record === undefined) { |
| 343 | const newRecord = { |
| 344 | status: 'rejected', |
| 345 | value: error, |
| 346 | }; |
| 347 | textCache.set(text, newRecord); |
| 348 | } else if (record.status === 'pending') { |
| 349 | const thenable = record.value; |
| 350 | record.status = 'rejected'; |
| 351 | record.value = error; |
| 352 | thenable.pings.forEach(t => t()); |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | function readText(text) { |
| 357 | const record = textCache.get(text); |
no test coverage detected