diff --git a/when/when-tests.ts b/when/when-tests.ts index 267493dd56..cdf252de88 100644 --- a/when/when-tests.ts +++ b/when/when-tests.ts @@ -380,6 +380,10 @@ example = function () { promise = nodefn.apply(nodeFn2, [1, '2']); +example = function() { + nodefn.apply(fs.read, arguments); +} + example = function () { var loadPasswd = nodefn.apply(fs.readFile, ['/etc/passwd']); diff --git a/when/when.d.ts b/when/when.d.ts index a9166ab62d..f2c194c07e 100644 --- a/when/when.d.ts +++ b/when/when.d.ts @@ -316,12 +316,12 @@ declare module "when/node" { ): when.Promise; - function apply(fn: _.NodeFn0, args: any[]): when.Promise; - function apply(fn: _.NodeFn1, args: any[]): when.Promise; - function apply(fn: _.NodeFn2, args: any[]): when.Promise; - function apply(fn: _.NodeFn3, args: any[]): when.Promise; - function apply(fn: _.NodeFn4, args: any[]): when.Promise; - function apply(fn: _.NodeFn5, args: any[]): when.Promise; + function apply(fn: _.NodeFn0, args: any[] | IArguments): when.Promise; + function apply(fn: _.NodeFn1, args: any[] | IArguments): when.Promise; + function apply(fn: _.NodeFn2, args: any[] | IArguments): when.Promise; + function apply(fn: _.NodeFn3, args: any[] | IArguments): when.Promise; + function apply(fn: _.NodeFn4, args: any[] | IArguments): when.Promise; + function apply(fn: _.NodeFn5, args: any[] | IArguments): when.Promise; function liftAll(srcApi: any, transform?: (destApi: any, liftedFunc: Function, name: string) => any, destApi?: any): any;