(promise)
| 25 | let withErrorsOrWarningsIgnored; |
| 26 | |
| 27 | function readValue(promise) { |
| 28 | if (typeof React.use === class="st">'function') { |
| 29 | return React.use(promise); |
| 30 | } |
| 31 | |
| 32 | class="cm">// Support for React < 19.0 |
| 33 | switch (promise.status) { |
| 34 | case class="st">'fulfilled': |
| 35 | return promise.value; |
| 36 | case class="st">'rejected': |
| 37 | throw promise.reason; |
| 38 | case class="st">'pending': |
| 39 | throw promise; |
| 40 | default: |
| 41 | promise.status = class="st">'pending'; |
| 42 | promise.then( |
| 43 | value => { |
| 44 | promise.status = class="st">'fulfilled'; |
| 45 | promise.value = value; |
| 46 | }, |
| 47 | reason => { |
| 48 | promise.status = class="st">'rejected'; |
| 49 | promise.reason = reason; |
| 50 | }, |
| 51 | ); |
| 52 | throw promise; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | beforeAll(() => { |
| 57 | class="cm">// JSDDOM doesnclass="st">'t implement getClientRects so we're just faking one for testing purposes |
no test coverage detected