TypeScript/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types

24 lines
1 KiB
Plaintext
Raw Normal View History

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