(options = kNullPrototo)
| 1010 | }, |
| 1011 | |
| 1012 | end(options = kNullPrototo) { |
| 1013 | if (error) { |
| 1014 | return PromiseReject(error); |
| 1015 | } |
| 1016 | if (closed) { |
| 1017 | return PromiseResolve(totalBytesWritten); |
| 1018 | } |
| 1019 | if (closing) { |
| 1020 | return pendingEndPromise; |
| 1021 | } |
| 1022 | validateObject(options, 'options'); |
| 1023 | const { |
| 1024 | signal, |
| 1025 | } = options; |
| 1026 | if (signal !== undefined) { |
| 1027 | validateAbortSignal(signal, 'options.signal'); |
| 1028 | if (signal.aborted) { |
| 1029 | return PromiseReject(signal.reason); |
| 1030 | } |
| 1031 | } |
| 1032 | closing = true; |
| 1033 | pendingEndPromise = PromisePrototypeThen( |
| 1034 | cleanup(), () => totalBytesWritten); |
| 1035 | return pendingEndPromise; |
| 1036 | }, |
| 1037 | |
| 1038 | endSync() { |
| 1039 | if (error) return -1; |
nothing calls this directly
no test coverage detected