diff options
Diffstat (limited to 'cli/js/web/streams')
-rw-r--r-- | cli/js/web/streams/readable-byte-stream-controller.ts | 2 | ||||
-rw-r--r-- | cli/js/web/streams/readable-internals.ts | 22 | ||||
-rw-r--r-- | cli/js/web/streams/readable-stream.ts | 14 | ||||
-rw-r--r-- | cli/js/web/streams/shared-internals.ts | 14 |
4 files changed, 27 insertions, 25 deletions
diff --git a/cli/js/web/streams/readable-byte-stream-controller.ts b/cli/js/web/streams/readable-byte-stream-controller.ts index 8067b5d35..1b473b77a 100644 --- a/cli/js/web/streams/readable-byte-stream-controller.ts +++ b/cli/js/web/streams/readable-byte-stream-controller.ts @@ -148,7 +148,7 @@ export class ReadableByteStreamController bytesFilled: 0, elementSize: 1, ctor: Uint8Array, - readerType: "default" + readerType: "default", }; this[rs.pendingPullIntos_].push(pullIntoDescriptor); } diff --git a/cli/js/web/streams/readable-internals.ts b/cli/js/web/streams/readable-internals.ts index b96262ef7..f46c79850 100644 --- a/cli/js/web/streams/readable-internals.ts +++ b/cli/js/web/streams/readable-internals.ts @@ -10,7 +10,7 @@ import { QueuingStrategy, QueuingStrategySizeCallback, UnderlyingSource, - UnderlyingByteSource + UnderlyingByteSource, } from "../dom_types.ts"; // ReadableStreamDefaultController @@ -345,7 +345,7 @@ export function readableStreamCancel<OutputType>( const sourceCancelPromise = stream[readableStreamController_][cancelSteps_]( reason ); - return sourceCancelPromise.then(_ => undefined); + return sourceCancelPromise.then((_) => undefined); } export function readableStreamClose<OutputType>( @@ -558,13 +558,13 @@ export function setUpReadableStreamDefaultController<OutputType>( const startResult = startAlgorithm(); Promise.resolve(startResult).then( - _ => { + (_) => { controller[started_] = true; // Assert: controller.[[pulling]] is false. // Assert: controller.[[pullAgain]] is false. readableStreamDefaultControllerCallPullIfNeeded(controller); }, - error => { + (error) => { readableStreamDefaultControllerError(controller, error); } ); @@ -678,14 +678,14 @@ export function readableStreamDefaultControllerCallPullIfNeeded<OutputType>( controller[pulling_] = true; controller[pullAlgorithm_](controller).then( - _ => { + (_) => { controller[pulling_] = false; if (controller[pullAgain_]) { controller[pullAgain_] = false; readableStreamDefaultControllerCallPullIfNeeded(controller); } }, - error => { + (error) => { readableStreamDefaultControllerError(controller, error); } ); @@ -768,13 +768,13 @@ export function setUpReadableByteStreamController( // Let startResult be the result of performing startAlgorithm. const startResult = startAlgorithm(); Promise.resolve(startResult).then( - _ => { + (_) => { controller[started_] = true; // Assert: controller.[[pulling]] is false. // Assert: controller.[[pullAgain]] is false. readableByteStreamControllerCallPullIfNeeded(controller); }, - error => { + (error) => { readableByteStreamControllerError(controller, error); } ); @@ -811,14 +811,14 @@ export function readableByteStreamControllerCallPullIfNeeded( // Assert: controller.[[pullAgain]] is false. controller[pulling_] = true; controller[pullAlgorithm_](controller).then( - _ => { + (_) => { controller[pulling_] = false; if (controller[pullAgain_]) { controller[pullAgain_] = false; readableByteStreamControllerCallPullIfNeeded(controller); } }, - error => { + (error) => { readableByteStreamControllerError(controller, error); } ); @@ -1122,7 +1122,7 @@ export function readableByteStreamControllerPullInto( bytesFilled: 0, elementSize, ctor, - readerType: "byob" + readerType: "byob", }; if (controller[pendingPullIntos_].length > 0) { diff --git a/cli/js/web/streams/readable-stream.ts b/cli/js/web/streams/readable-stream.ts index e062c278e..50753260d 100644 --- a/cli/js/web/streams/readable-stream.ts +++ b/cli/js/web/streams/readable-stream.ts @@ -11,18 +11,18 @@ import { QueuingStrategy, QueuingStrategySizeCallback, UnderlyingSource, - UnderlyingByteSource + UnderlyingByteSource, } from "../dom_types.ts"; import { ReadableStreamDefaultController, - setUpReadableStreamDefaultControllerFromUnderlyingSource + setUpReadableStreamDefaultControllerFromUnderlyingSource, } from "./readable-stream-default-controller.ts"; import { ReadableStreamDefaultReader } from "./readable-stream-default-reader.ts"; import { ReadableByteStreamController, - setUpReadableByteStreamControllerFromUnderlyingSource + setUpReadableByteStreamControllerFromUnderlyingSource, } from "./readable-byte-stream-controller.ts"; import { SDReadableStreamBYOBReader } from "./readable-stream-byob-reader.ts"; @@ -123,7 +123,7 @@ export class SDReadableStream<OutputType> return rs.readableStreamCancel(this, reason); } - tee(): Array<SDReadableStream<OutputType>> { + tee(): [SDReadableStream<OutputType>, SDReadableStream<OutputType>] { return readableStreamTee(this, false); } @@ -280,7 +280,9 @@ export function readableStreamTee<OutputType>( let branch2: SDReadableStream<OutputType>; let cancelResolve: (reason: shared.ErrorResult) => void; - const cancelPromise = new Promise<void>(resolve => (cancelResolve = resolve)); + const cancelPromise = new Promise<void>( + (resolve) => (cancelResolve = resolve) + ); const pullAlgorithm = (): Promise<void> => { return rs @@ -362,7 +364,7 @@ export function readableStreamTee<OutputType>( cancel2Algorithm ); - reader[rs.closedPromise_].promise.catch(error => { + reader[rs.closedPromise_].promise.catch((error) => { if (!closedOrErrored) { rs.readableStreamDefaultControllerError( branch1![ diff --git a/cli/js/web/streams/shared-internals.ts b/cli/js/web/streams/shared-internals.ts index 3d802b083..7b0de2274 100644 --- a/cli/js/web/streams/shared-internals.ts +++ b/cli/js/web/streams/shared-internals.ts @@ -223,7 +223,7 @@ export function createAlgorithmFromUnderlyingMethod< if (typeof method !== "function") { throw new TypeError(`Field "${methodName}" is not a function.`); } - return function(...fnArgs: any[]): any { + return function (...fnArgs: any[]): any { return promiseCall(method, obj, fnArgs.concat(extraArgs)); }; } @@ -252,7 +252,7 @@ export function makeSizeAlgorithmFromSizeFunction<T>( if (typeof sizeFn !== "function" && typeof sizeFn !== "undefined") { throw new TypeError("size function must be undefined or a function"); } - return function(chunk: T): number { + return function (chunk: T): number { if (typeof sizeFn === "function") { return sizeFn(chunk); } @@ -265,7 +265,7 @@ export function makeSizeAlgorithmFromSizeFunction<T>( export const enum ControlledPromiseState { Pending, Resolved, - Rejected + Rejected, } export interface ControlledPromise<V> { @@ -277,14 +277,14 @@ export interface ControlledPromise<V> { export function createControlledPromise<V>(): ControlledPromise<V> { const conProm = { - state: ControlledPromiseState.Pending + state: ControlledPromiseState.Pending, } as ControlledPromise<V>; - conProm.promise = new Promise<V>(function(resolve, reject) { - conProm.resolve = function(v?: V): void { + conProm.promise = new Promise<V>(function (resolve, reject) { + conProm.resolve = function (v?: V): void { conProm.state = ControlledPromiseState.Resolved; resolve(v); }; - conProm.reject = function(e?: ErrorResult): void { + conProm.reject = function (e?: ErrorResult): void { conProm.state = ControlledPromiseState.Rejected; reject(e); }; |