(text)
| 88 | }); |
| 89 | |
| 90 | function resolveText(text) { |
| 91 | const record = textCache.get(text); |
| 92 | if (record === undefined) { |
| 93 | const newRecord = { |
| 94 | status: 'resolved', |
| 95 | value: text, |
| 96 | }; |
| 97 | textCache.set(text, newRecord); |
| 98 | } else if (record.status === 'pending') { |
| 99 | const thenable = record.value; |
| 100 | record.status = 'resolved'; |
| 101 | record.value = text; |
| 102 | thenable.pings.forEach(t => t(text)); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | function readText(text) { |
| 107 | const record = textCache.get(text); |
no test coverage detected