TypeScript/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types

24 lines
509 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/fatarrowfunctionsInFunctionParameterDefaults.ts ===
function fn(x = () => this, y = x()) {
>fn : (x?: () => any, y?: any) => any
>x : () => any
2014-08-15 23:33:16 +02:00
>() => this : () => any
>this : any
>y : any
2014-08-15 23:33:16 +02:00
>x() : any
>x : () => any
2014-08-15 23:33:16 +02:00
// should be 4
return y;
>y : any
2014-08-15 23:33:16 +02:00
}
fn.call(4); // Should be 4
>fn.call(4) : any
>fn.call : (thisArg: any, ...argArray: any[]) => any
>fn : (x?: () => any, y?: any) => any
>call : (thisArg: any, ...argArray: any[]) => any
2015-04-13 21:36:11 +02:00
>4 : number
2014-08-15 23:33:16 +02:00