Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using Bluebird warning are raied about created but not returned promises #90

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/lib/readable-stream/byte-stream-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -996,18 +996,12 @@ export function SetUpReadableByteStreamControllerFromUnderlyingSource(
const controller: ReadableByteStreamController = Object.create(ReadableByteStreamController.prototype);

let startAlgorithm: () => void | PromiseLike<void> = () => undefined;
let pullAlgorithm: () => Promise<void> = () => promiseResolvedWith(undefined);
let cancelAlgorithm: (reason: any) => Promise<void> = () => promiseResolvedWith(undefined);
let pullAlgorithm: () => Promise<void> = underlyingByteSource.pull !== undefined ? () => underlyingByteSource.pull!(controller) : () => promiseResolvedWith(undefined);
let cancelAlgorithm: (reason: any) => Promise<void> = underlyingByteSource.cancel !== undefined ? reason => underlyingByteSource.cancel!(reason) : () => promiseResolvedWith(undefined);

if (underlyingByteSource.start !== undefined) {
startAlgorithm = () => underlyingByteSource.start!(controller);
}
if (underlyingByteSource.pull !== undefined) {
pullAlgorithm = () => underlyingByteSource.pull!(controller);
}
if (underlyingByteSource.cancel !== undefined) {
cancelAlgorithm = reason => underlyingByteSource.cancel!(reason);
}

const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;
if (autoAllocateChunkSize === 0) {
Expand Down
10 changes: 2 additions & 8 deletions src/lib/readable-stream/default-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,18 +375,12 @@ export function SetUpReadableStreamDefaultControllerFromUnderlyingSource<R>(
const controller: ReadableStreamDefaultController<R> = Object.create(ReadableStreamDefaultController.prototype);

let startAlgorithm: () => void | PromiseLike<void> = () => undefined;
let pullAlgorithm: () => Promise<void> = () => promiseResolvedWith(undefined);
let cancelAlgorithm: (reason: any) => Promise<void> = () => promiseResolvedWith(undefined);
let pullAlgorithm: () => Promise<void> = underlyingSource.pull !== undefined ? () => underlyingSource.pull!(controller) : () => promiseResolvedWith(undefined);
let cancelAlgorithm: (reason: any) => Promise<void> = underlyingSource.cancel !== undefined ? reason => underlyingSource.cancel!(reason) : () => promiseResolvedWith(undefined);

if (underlyingSource.start !== undefined) {
startAlgorithm = () => underlyingSource.start!(controller);
}
if (underlyingSource.pull !== undefined) {
pullAlgorithm = () => underlyingSource.pull!(controller);
}
if (underlyingSource.cancel !== undefined) {
cancelAlgorithm = reason => underlyingSource.cancel!(reason);
}

SetUpReadableStreamDefaultController(
stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm
Expand Down