Merge pull request #8354 from Microsoft/revert-this-types-for-function-bind

Revert this types for function bind
This commit is contained in:
Nathan Shively-Sanders
2016-04-28 09:36:50 -07:00
18 changed files with 66 additions and 69 deletions
-3
View File
@@ -215,7 +215,6 @@ interface Function {
* @param thisArg The object to be used as the this object.
* @param argArray A set of arguments to be passed to the function.
*/
apply<T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U;
apply(this: Function, thisArg: any, argArray?: any): any;
/**
@@ -223,7 +222,6 @@ interface Function {
* @param thisArg The object to be used as the current object.
* @param argArray A list of arguments to be passed to the method.
*/
call<T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U;
call(this: Function, thisArg: any, ...argArray: any[]): any;
/**
@@ -232,7 +230,6 @@ interface Function {
* @param thisArg An object to which the this keyword can refer inside the new function.
* @param argArray A list of arguments to be passed to the new function.
*/
bind<T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): (this: void, ...argArray: any[]) => U;
bind(this: Function, thisArg: any, ...argArray: any[]): any;
prototype: any;
@@ -5,7 +5,7 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '
Property 'apply' is missing in type '{}'.
tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function'.
Types of property 'apply' are incompatible.
Type 'number' is not assignable to type '{ <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }'.
Type 'number' is not assignable to type '(this: Function, thisArg: any, argArray?: any) => any'.
==== tests/cases/compiler/assignmentToObjectAndFunction.ts (3 errors) ====
@@ -48,4 +48,4 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type
~~~~~~~~~~
!!! error TS2322: Type 'typeof bad' is not assignable to type 'Function'.
!!! error TS2322: Types of property 'apply' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '{ <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }'.
!!! error TS2322: Type 'number' is not assignable to type '(this: Function, thisArg: any, argArray?: any) => any'.
@@ -10,9 +10,9 @@ class C {
var fn = async () => await other.apply(this, arguments);
>fn : Symbol(fn, Decl(asyncArrowFunctionCapturesArguments_es6.ts, 3, 9))
>other.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>other.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --))
>other : Symbol(other, Decl(asyncArrowFunctionCapturesArguments_es6.ts, 1, 13))
>apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --))
>this : Symbol(C, Decl(asyncArrowFunctionCapturesArguments_es6.ts, 0, 0))
>arguments : Symbol(arguments)
}
@@ -9,13 +9,13 @@ class C {
>other : () => void
var fn = async () => await other.apply(this, arguments);
>fn : () => Promise<void>
>async () => await other.apply(this, arguments) : () => Promise<void>
>await other.apply(this, arguments) : void
>other.apply(this, arguments) : void
>other.apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>fn : () => Promise<any>
>async () => await other.apply(this, arguments) : () => Promise<any>
>await other.apply(this, arguments) : any
>other.apply(this, arguments) : any
>other.apply : (this: Function, thisArg: any, argArray?: any) => any
>other : () => void
>apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>apply : (this: Function, thisArg: any, argArray?: any) => any
>this : this
>arguments : IArguments
}
@@ -68,9 +68,9 @@ export async function runSampleWorks<A, B, C, D, E>(
>T : Symbol(T, Decl(declarationEmitPromise.ts, 8, 16))
f.apply(this, result);
>f.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>f.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --))
>f : Symbol(f, Decl(declarationEmitPromise.ts, 8, 19))
>apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --))
>result : Symbol(result, Decl(declarationEmitPromise.ts, 7, 7))
let rfunc: typeof func & {} = func as any; // <- This is the only difference
@@ -140,9 +140,9 @@ export async function runSampleBreaks<A, B, C, D, E>(
>T : Symbol(T, Decl(declarationEmitPromise.ts, 17, 16))
f.apply(this, result);
>f.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>f.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --))
>f : Symbol(f, Decl(declarationEmitPromise.ts, 17, 19))
>apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --))
>result : Symbol(result, Decl(declarationEmitPromise.ts, 16, 7))
let rfunc: typeof func = func as any; // <- This is the only difference
@@ -78,10 +78,10 @@ export async function runSampleWorks<A, B, C, D, E>(
>T : T
f.apply(this, result);
>f.apply(this, result) : T
>f.apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>f.apply(this, result) : any
>f.apply : (this: Function, thisArg: any, argArray?: any) => any
>f : (a: A, b?: B, c?: C, d?: D, e?: E) => T
>apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>apply : (this: Function, thisArg: any, argArray?: any) => any
>this : any
>result : any
@@ -163,10 +163,10 @@ export async function runSampleBreaks<A, B, C, D, E>(
>T : T
f.apply(this, result);
>f.apply(this, result) : T
>f.apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>f.apply(this, result) : any
>f.apply : (this: Function, thisArg: any, argArray?: any) => any
>f : (a: A, b?: B, c?: C, d?: D, e?: E) => T
>apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>apply : (this: Function, thisArg: any, argArray?: any) => any
>this : any
>result : any
@@ -12,7 +12,7 @@ function fn(x = () => this, y = x()) {
}
fn.call(4); // Should be 4
>fn.call : Symbol(Function.call, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>fn.call : Symbol(Function.call, Decl(lib.d.ts, --, --))
>fn : Symbol(fn, Decl(fatarrowfunctionsInFunctionParameterDefaults.ts, 0, 0))
>call : Symbol(Function.call, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>call : Symbol(Function.call, Decl(lib.d.ts, --, --))
@@ -16,8 +16,8 @@ function fn(x = () => this, y = x()) {
fn.call(4); // Should be 4
>fn.call(4) : any
>fn.call : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U; (this: Function, thisArg: any, ...argArray: any[]): any; }
>fn.call : (this: Function, thisArg: any, ...argArray: any[]) => any
>fn : (x?: () => any, y?: any) => any
>call : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U; (this: Function, thisArg: any, ...argArray: any[]): any; }
>call : (this: Function, thisArg: any, ...argArray: any[]) => any
>4 : number
@@ -3,9 +3,9 @@ function salt() {}
>salt : Symbol(salt, Decl(functionType.ts, 0, 0))
salt.apply("hello", []);
>salt.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>salt.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>salt : Symbol(salt, Decl(functionType.ts, 0, 0))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
(new Function("return 5"))();
>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
+3 -3
View File
@@ -3,10 +3,10 @@ function salt() {}
>salt : () => void
salt.apply("hello", []);
>salt.apply("hello", []) : void
>salt.apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>salt.apply("hello", []) : any
>salt.apply : (this: Function, thisArg: any, argArray?: any) => any
>salt : () => void
>apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>apply : (this: Function, thisArg: any, argArray?: any) => any
>"hello" : string
>[] : undefined[]
@@ -24,9 +24,9 @@ function compose<A, B, C>(f: (b: B) => C, g: (a:A) => B): (a:A) => C {
return f(g.apply(null, a));
>f : Symbol(f, Decl(genericTypeParameterEquivalence2.ts, 1, 26))
>g.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>g.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>g : Symbol(g, Decl(genericTypeParameterEquivalence2.ts, 1, 41))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>a : Symbol(a, Decl(genericTypeParameterEquivalence2.ts, 2, 21))
};
@@ -26,10 +26,10 @@ function compose<A, B, C>(f: (b: B) => C, g: (a:A) => B): (a:A) => C {
return f(g.apply(null, a));
>f(g.apply(null, a)) : C
>f : (b: B) => C
>g.apply(null, a) : B
>g.apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>g.apply(null, a) : any
>g.apply : (this: Function, thisArg: any, argArray?: any) => any
>g : (a: A) => B
>apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>apply : (this: Function, thisArg: any, argArray?: any) => any
>null : null
>a : A
@@ -26,39 +26,39 @@ function apply(func, thisArg, args) {
>length : Symbol(length, Decl(_apply.js, 12, 7))
case 0: return func.call(thisArg);
>func.call : Symbol(Function.call, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>func.call : Symbol(Function.call, Decl(lib.d.ts, --, --))
>func : Symbol(func, Decl(_apply.js, 11, 15))
>call : Symbol(Function.call, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>call : Symbol(Function.call, Decl(lib.d.ts, --, --))
>thisArg : Symbol(thisArg, Decl(_apply.js, 11, 20))
case 1: return func.call(thisArg, args[0]);
>func.call : Symbol(Function.call, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>func.call : Symbol(Function.call, Decl(lib.d.ts, --, --))
>func : Symbol(func, Decl(_apply.js, 11, 15))
>call : Symbol(Function.call, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>call : Symbol(Function.call, Decl(lib.d.ts, --, --))
>thisArg : Symbol(thisArg, Decl(_apply.js, 11, 20))
>args : Symbol(args, Decl(_apply.js, 11, 29))
case 2: return func.call(thisArg, args[0], args[1]);
>func.call : Symbol(Function.call, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>func.call : Symbol(Function.call, Decl(lib.d.ts, --, --))
>func : Symbol(func, Decl(_apply.js, 11, 15))
>call : Symbol(Function.call, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>call : Symbol(Function.call, Decl(lib.d.ts, --, --))
>thisArg : Symbol(thisArg, Decl(_apply.js, 11, 20))
>args : Symbol(args, Decl(_apply.js, 11, 29))
>args : Symbol(args, Decl(_apply.js, 11, 29))
case 3: return func.call(thisArg, args[0], args[1], args[2]);
>func.call : Symbol(Function.call, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>func.call : Symbol(Function.call, Decl(lib.d.ts, --, --))
>func : Symbol(func, Decl(_apply.js, 11, 15))
>call : Symbol(Function.call, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>call : Symbol(Function.call, Decl(lib.d.ts, --, --))
>thisArg : Symbol(thisArg, Decl(_apply.js, 11, 20))
>args : Symbol(args, Decl(_apply.js, 11, 29))
>args : Symbol(args, Decl(_apply.js, 11, 29))
>args : Symbol(args, Decl(_apply.js, 11, 29))
}
return func.apply(thisArg, args);
>func.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>func.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>func : Symbol(func, Decl(_apply.js, 11, 15))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>thisArg : Symbol(thisArg, Decl(_apply.js, 11, 20))
>args : Symbol(args, Decl(_apply.js, 11, 29))
}
@@ -28,17 +28,17 @@ function apply(func, thisArg, args) {
case 0: return func.call(thisArg);
>0 : number
>func.call(thisArg) : any
>func.call : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U; (this: Function, thisArg: any, ...argArray: any[]): any; }
>func.call : (this: Function, thisArg: any, ...argArray: any[]) => any
>func : Function
>call : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U; (this: Function, thisArg: any, ...argArray: any[]): any; }
>call : (this: Function, thisArg: any, ...argArray: any[]) => any
>thisArg : any
case 1: return func.call(thisArg, args[0]);
>1 : number
>func.call(thisArg, args[0]) : any
>func.call : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U; (this: Function, thisArg: any, ...argArray: any[]): any; }
>func.call : (this: Function, thisArg: any, ...argArray: any[]) => any
>func : Function
>call : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U; (this: Function, thisArg: any, ...argArray: any[]): any; }
>call : (this: Function, thisArg: any, ...argArray: any[]) => any
>thisArg : any
>args[0] : any
>args : any[]
@@ -47,9 +47,9 @@ function apply(func, thisArg, args) {
case 2: return func.call(thisArg, args[0], args[1]);
>2 : number
>func.call(thisArg, args[0], args[1]) : any
>func.call : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U; (this: Function, thisArg: any, ...argArray: any[]): any; }
>func.call : (this: Function, thisArg: any, ...argArray: any[]) => any
>func : Function
>call : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U; (this: Function, thisArg: any, ...argArray: any[]): any; }
>call : (this: Function, thisArg: any, ...argArray: any[]) => any
>thisArg : any
>args[0] : any
>args : any[]
@@ -61,9 +61,9 @@ function apply(func, thisArg, args) {
case 3: return func.call(thisArg, args[0], args[1], args[2]);
>3 : number
>func.call(thisArg, args[0], args[1], args[2]) : any
>func.call : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U; (this: Function, thisArg: any, ...argArray: any[]): any; }
>func.call : (this: Function, thisArg: any, ...argArray: any[]) => any
>func : Function
>call : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, ...argArray: any[]): U; (this: Function, thisArg: any, ...argArray: any[]): any; }
>call : (this: Function, thisArg: any, ...argArray: any[]) => any
>thisArg : any
>args[0] : any
>args : any[]
@@ -77,9 +77,9 @@ function apply(func, thisArg, args) {
}
return func.apply(thisArg, args);
>func.apply(thisArg, args) : any
>func.apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>func.apply : (this: Function, thisArg: any, argArray?: any) => any
>func : Function
>apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>apply : (this: Function, thisArg: any, argArray?: any) => any
>thisArg : any
>args : any[]
}
@@ -20,9 +20,9 @@ var r2b: (x: any, y?: any) => any = i.apply;
>r2b : Symbol(r2b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 3))
>x : Symbol(x, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 10))
>y : Symbol(y, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 17))
>i.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>i.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>i : Symbol(i, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 7, 3))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
var b: {
>b : Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3))
@@ -38,7 +38,7 @@ var rb4: (x: any, y?: any) => any = b.apply;
>rb4 : Symbol(rb4, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 3))
>x : Symbol(x, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 10))
>y : Symbol(y, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 17))
>b.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>b.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>b : Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
@@ -21,9 +21,9 @@ var r2b: (x: any, y?: any) => any = i.apply;
>r2b : (x: any, y?: any) => any
>x : any
>y : any
>i.apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>i.apply : (this: Function, thisArg: any, argArray?: any) => any
>i : I
>apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>apply : (this: Function, thisArg: any, argArray?: any) => any
var b: {
>b : () => void
@@ -40,7 +40,7 @@ var rb4: (x: any, y?: any) => any = b.apply;
>rb4 : (x: any, y?: any) => any
>x : any
>y : any
>b.apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>b.apply : (this: Function, thisArg: any, argArray?: any) => any
>b : () => void
>apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>apply : (this: Function, thisArg: any, argArray?: any) => any
@@ -12,13 +12,13 @@ module M1 {
>A : Symbol(A, Decl(returnTypeParameterWithModules.ts, 1, 27))
return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]);
>Array.prototype.reduce.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>Array.prototype.reduce.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>Array.prototype.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, --, --))
>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, --, --))
>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>apply : Symbol(Function.apply, Decl(lib.d.ts, --, --))
>ar : Symbol(ar, Decl(returnTypeParameterWithModules.ts, 1, 30))
>e : Symbol(e, Decl(returnTypeParameterWithModules.ts, 1, 36))
>f : Symbol(f, Decl(returnTypeParameterWithModules.ts, 1, 33))
@@ -13,13 +13,13 @@ module M1 {
return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]);
>Array.prototype.reduce.apply(ar, e ? [f, e] : [f]) : any
>Array.prototype.reduce.apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>Array.prototype.reduce.apply : (this: Function, thisArg: any, argArray?: any) => any
>Array.prototype.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
>Array.prototype : any[]
>Array : ArrayConstructor
>prototype : any[]
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
>apply : { <T, U>(this: (this: T, ...argArray: any[]) => U, thisArg: T, argArray?: any): U; (this: Function, thisArg: any, argArray?: any): any; }
>apply : (this: Function, thisArg: any, argArray?: any) => any
>ar : any
>e ? [f, e] : [f] : any[]
>e : any