From f57187fb4a9144d71d435982fdbba099e51a9d3b Mon Sep 17 00:00:00 2001 From: Igor Oleinikov Date: Sun, 22 Dec 2013 15:52:14 +0400 Subject: [PATCH] q: fixed definition and tests to align with 0.9.5 function call resolution --- q/Q-tests.ts | 4 ++-- q/Q.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/q/Q-tests.ts b/q/Q-tests.ts index 21fc95138..d08ae5111 100644 --- a/q/Q-tests.ts +++ b/q/Q-tests.ts @@ -23,7 +23,7 @@ Q.delay(8, 1000).then(x => x.toExponential()); Q.delay(Q("asdf"), 1000).then(x => x.length); Q.delay("asdf", 1000).then(x => x.length); -var eventualAdd = Q.promised((a: number, b: number) => a + b); +var eventualAdd = Q.promised((a?: number, b?: number) => a + b); eventualAdd(Q(1), Q(2)).then(x => x.toExponential()); var eventually = function (eventually) { @@ -90,7 +90,7 @@ Q.all(promiseArray).then(nums => nums.map(num => num.toPrecision(2)).join(',')); Q.all(myNums).then(nums => nums.map(Math.round)); -Q.fbind((dateString) => new Date(dateString), "11/11/1991")().then(d => d.toLocaleDateString()); +Q.fbind((dateString?) => new Date(dateString), "11/11/1991")().then(d => d.toLocaleDateString()); Q.when(8, num => num + "!"); Q.when(Q(8), num => num + "!").then(str => str.split(',')); diff --git a/q/Q.d.ts b/q/Q.d.ts index 31537423f..d61c34d54 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -106,8 +106,8 @@ declare module Q { export function nsend(nodeModule: any, functionName: string, ...args: any[]): Promise; export function nmcall(nodeModule: any, functionName: string, ...args: any[]): Promise; + export function all(promises: IPromise[]): Promise; export function all(promises: any[]): Promise; - export function all(promises: IPromise[]): Promise; export function allSettled(promises: any[]): Promise[]>; export function allSettled(promises: IPromise[]): Promise[]>;