• Home
  • Raw
  • Download

Lines Matching refs:kState

67   kState,
160 this[kState] = {
270 state: this[kState].state,
278 this[kState].transfer.port1?.close();
279 this[kState].transfer.port1 = undefined;
280 this[kState].transfer.port2 = undefined;
291 this[kState].transfer.port1);
293 this[kState].transfer.readable = readable;
294 this[kState].transfer.promise = promise;
296 setPromiseHandled(this[kState].transfer.promise);
299 data: { port: this[kState].transfer.port2 },
307 this[kState].transfer.port1 = port1;
308 this[kState].transfer.port2 = port2;
334 this[kState] = {
389 this[kState] = {
412 return this[kState].close.promise;
422 if (this[kState].stream === undefined) {
436 return this[kState].ready.promise;
446 if (this[kState].stream === undefined) {
462 } = this[kState];
480 } = this[kState];
483 assert(stream[kState].writer !== undefined);
494 if (this[kState].stream === undefined) {
504 stream: this[kState].stream,
505 close: this[kState].close.promise,
506 ready: this[kState].ready.promise,
531 const result = this[kState].abortAlgorithm(reason);
546 return this[kState].abortController.signal;
555 if (this[kState].stream[kState].state !== 'writable')
562 stream: this[kState].stream,
589 return stream[kState].writer !== undefined;
595 writer[kState].stream = stream;
596 stream[kState].writer = writer;
597 switch (stream[kState].state) {
600 stream[kState].backpressure) {
601 writer[kState].ready = createDeferredPromise();
603 writer[kState].ready = {
612 writer[kState].ready = {
613 promise: PromiseReject(stream[kState].storedError),
617 setPromiseHandled(writer[kState].ready.promise);
621 writer[kState].ready = {
626 writer[kState].close = {
633 writer[kState].ready = {
634 promise: PromiseReject(stream[kState].storedError),
638 writer[kState].close = {
639 promise: PromiseReject(stream[kState].storedError),
643 setPromiseHandled(writer[kState].ready.promise);
644 setPromiseHandled(writer[kState].close.promise);
648 writer[kState].close = createDeferredPromise();
656 } = stream[kState];
660 controller[kState].abortController.abort(reason);
662 if (stream[kState].pendingAbortRequest.abort.promise !== undefined)
663 return stream[kState].pendingAbortRequest.abort.promise;
675 stream[kState].pendingAbortRequest = {
693 } = stream[kState];
700 stream[kState].closeRequest = createDeferredPromise();
701 const { promise } = stream[kState].closeRequest;
703 writer[kState].ready.resolve?.();
709 assert(stream[kState].state === 'writable');
713 } = stream[kState];
714 if (writer !== undefined && stream[kState].backpressure !== backpressure) {
716 writer[kState].ready = createDeferredPromise();
718 writer[kState].ready.resolve?.();
721 stream[kState].backpressure = backpressure;
725 assert(stream[kState].storedError === undefined);
726 assert(stream[kState].state === 'writable');
730 } = stream[kState];
732 stream[kState].state = 'erroring';
733 stream[kState].storedError = reason;
738 controller[kState].started) {
744 assert(stream[kState].state === 'errored');
745 if (stream[kState].closeRequest.promise !== undefined) {
746 assert(stream[kState].inFlightCloseRequest.promise === undefined);
747 stream[kState].closeRequest.reject?.(stream[kState].storedError);
748 stream[kState].closeRequest = {
755 stream[kIsClosedPromise].reject(stream[kState]?.storedError);
760 } = stream[kState];
762 writer[kState].close.reject?.(stream[kState].storedError);
763 setPromiseHandled(writer[kState].close.promise);
768 assert(stream[kState].inFlightWriteRequest.promise === undefined);
769 assert(stream[kState].writeRequests.length);
770 const writeRequest = ArrayPrototypeShift(stream[kState].writeRequests);
771 stream[kState].inFlightWriteRequest = writeRequest;
775 assert(stream[kState].inFlightWriteRequest.promise === undefined);
776 assert(stream[kState].closeRequest.promise !== undefined);
777 stream[kState].inFlightCloseRequest = stream[kState].closeRequest;
778 stream[kState].closeRequest = {
789 } = stream[kState];
798 assert(stream[kState].inFlightWriteRequest.promise !== undefined);
799 stream[kState].inFlightWriteRequest.reject?.(error);
800 stream[kState].inFlightWriteRequest = {
805 assert(stream[kState].state === 'writable' ||
806 stream[kState].state === 'erroring');
811 assert(stream[kState].inFlightWriteRequest.promise !== undefined);
812 stream[kState].inFlightWriteRequest.resolve?.();
813 stream[kState].inFlightWriteRequest = {
821 assert(stream[kState].inFlightCloseRequest.promise !== undefined);
822 stream[kState].inFlightCloseRequest.reject?.(error);
823 stream[kState].inFlightCloseRequest = {
828 assert(stream[kState].state === 'writable' ||
829 stream[kState].state === 'erroring');
830 if (stream[kState].pendingAbortRequest.abort.promise !== undefined) {
831 stream[kState].pendingAbortRequest.abort.reject?.(error);
832 stream[kState].pendingAbortRequest = {
846 assert(stream[kState].inFlightCloseRequest.promise !== undefined);
847 stream[kState].inFlightCloseRequest.resolve?.();
848 stream[kState].inFlightCloseRequest = {
853 if (stream[kState].state === 'erroring') {
854 stream[kState].storedError = undefined;
855 if (stream[kState].pendingAbortRequest.abort.promise !== undefined) {
856 stream[kState].pendingAbortRequest.abort.resolve?.();
857 stream[kState].pendingAbortRequest = {
868 stream[kState].state = 'closed';
869 if (stream[kState].writer !== undefined)
870 stream[kState].writer[kState].close.resolve?.();
872 assert(stream[kState].pendingAbortRequest.abort.promise === undefined);
873 assert(stream[kState].storedError === undefined);
877 assert(stream[kState].state === 'erroring');
879 stream[kState].state = 'errored';
880 stream[kState].controller[kError]();
881 const storedError = stream[kState].storedError;
882 for (let n = 0; n < stream[kState].writeRequests.length; n++)
883 stream[kState].writeRequests[n].reject?.(storedError);
884 stream[kState].writeRequests = [];
886 if (stream[kState].pendingAbortRequest.abort.promise === undefined) {
891 const abortRequest = stream[kState].pendingAbortRequest;
892 stream[kState].pendingAbortRequest = {
908 stream[kState].controller[kAbort],
909 stream[kState].controller,
924 } = stream[kState];
935 if (stream[kState].closeRequest.promise === undefined &&
936 stream[kState].inFlightCloseRequest.promise === undefined) {
944 assert(stream[kState].state === 'writable');
951 stream[kState].writeRequests,
963 } = writer[kState];
967 } = stream[kState];
971 if (stream !== writer[kState].stream) {
977 } = stream[kState];
980 return PromiseReject(stream[kState].storedError);
988 return PromiseReject(stream[kState].storedError);
1000 } = writer[kState];
1002 assert(stream[kState].writer === writer);
1006 stream[kState].writer = undefined;
1007 writer[kState].stream = undefined;
1013 } = writer[kState];
1014 switch (stream[kState].state) {
1023 stream[kState].controller);
1027 if (isPromisePending(writer[kState].ready.promise)) {
1028 writer[kState].ready.reject?.(error);
1030 writer[kState].ready = {
1036 setPromiseHandled(writer[kState].ready.promise);
1040 if (isPromisePending(writer[kState].close.promise)) {
1041 writer[kState].close.reject?.(error);
1043 writer[kState].close = {
1049 setPromiseHandled(writer[kState].close.promise);
1055 } = writer[kState];
1059 } = stream[kState];
1064 return PromiseReject(stream[kState].storedError);
1074 } = writer[kState];
1082 } = writer[kState];
1096 } = controller[kState];
1098 stream[kState].state === 'writable') {
1110 } = controller[kState];
1119 } = stream[kState];
1131 if (stream[kState].state === 'writable')
1143 } = controller[kState];
1159 } = controller[kState];
1166 controller[kState].sizeAlgorithm,
1178 } = controller[kState];
1179 if (stream[kState].state === 'writable')
1186 } = controller[kState];
1187 assert(stream[kState].state === 'writable');
1198 controller[kState].writeAlgorithm = undefined;
1199 controller[kState].closeAlgorithm = undefined;
1200 controller[kState].abortAlgorithm = undefined;
1201 controller[kState].sizeAlgorithm = undefined;
1213 } = controller[kState];
1214 if (!started || stream[kState].inFlightWriteRequest.promise !== undefined)
1217 if (stream[kState].state === 'erroring') {
1273 assert(stream[kState].controller === undefined);
1274 controller[kState] = {
1286 stream[kState].controller = controller;
1298 assert(stream[kState].state === 'writable' ||
1299 stream[kState].state === 'erroring');
1300 controller[kState].started = true;
1304 assert(stream[kState].state === 'writable' ||
1305 stream[kState].state === 'erroring');
1306 controller[kState].started = true;