(cb)
| 819 | } |
| 820 | |
| 821 | function _final(cb) { |
| 822 | if (!hasEnd) { |
| 823 | queueMicrotask(cb); |
| 824 | return; |
| 825 | } |
| 826 | if (hasEndSync) { |
| 827 | try { |
| 828 | const result = writer.endSync(); |
| 829 | if (result >= 0) { |
| 830 | queueMicrotask(cb); |
| 831 | return; |
| 832 | } |
| 833 | // Result < 0: can't end synchronously, fall through to async. |
| 834 | } catch (err) { |
| 835 | cb(err); |
| 836 | return; |
| 837 | } |
| 838 | } |
| 839 | try { |
| 840 | PromisePrototypeThen(writer.end(), () => cb(), cb); |
| 841 | } catch (err) { |
| 842 | cb(err); |
| 843 | } |
| 844 | } |
| 845 | |
| 846 | function _destroy(err, cb) { |
| 847 | if (err && hasFail) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…