TypeScript/tests/baselines/reference/arrowFunctionExpressions.types

355 lines
16 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/expressions/functions/arrowFunctionExpressions.ts ===
// ArrowFormalParameters => AssignmentExpression is equivalent to ArrowFormalParameters => { return AssignmentExpression; }
var a = (p: string) => p.length;
2015-04-13 23:01:57 +02:00
>a : (p: string) => number, Symbol(a, Decl(arrowFunctionExpressions.ts, 1, 3), Decl(arrowFunctionExpressions.ts, 2, 3))
2014-08-15 23:33:16 +02:00
>(p: string) => p.length : (p: string) => number
2015-04-13 23:01:57 +02:00
>p : string, Symbol(p, Decl(arrowFunctionExpressions.ts, 1, 9))
>p.length : number, Symbol(String.length, Decl(lib.d.ts, 414, 19))
>p : string, Symbol(p, Decl(arrowFunctionExpressions.ts, 1, 9))
>length : number, Symbol(String.length, Decl(lib.d.ts, 414, 19))
2014-08-15 23:33:16 +02:00
var a = (p: string) => { return p.length; }
2015-04-13 23:01:57 +02:00
>a : (p: string) => number, Symbol(a, Decl(arrowFunctionExpressions.ts, 1, 3), Decl(arrowFunctionExpressions.ts, 2, 3))
2014-08-15 23:33:16 +02:00
>(p: string) => { return p.length; } : (p: string) => number
2015-04-13 23:01:57 +02:00
>p : string, Symbol(p, Decl(arrowFunctionExpressions.ts, 2, 9))
>p.length : number, Symbol(String.length, Decl(lib.d.ts, 414, 19))
>p : string, Symbol(p, Decl(arrowFunctionExpressions.ts, 2, 9))
>length : number, Symbol(String.length, Decl(lib.d.ts, 414, 19))
2014-08-15 23:33:16 +02:00
// Identifier => Block is equivalent to(Identifier) => Block
var b = j => { return 0; }
2015-04-13 23:01:57 +02:00
>b : (j: any) => number, Symbol(b, Decl(arrowFunctionExpressions.ts, 5, 3), Decl(arrowFunctionExpressions.ts, 6, 3))
2014-08-15 23:33:16 +02:00
>j => { return 0; } : (j: any) => number
2015-04-13 23:01:57 +02:00
>j : any, Symbol(j, Decl(arrowFunctionExpressions.ts, 5, 7))
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
var b = (j) => { return 0; }
2015-04-13 23:01:57 +02:00
>b : (j: any) => number, Symbol(b, Decl(arrowFunctionExpressions.ts, 5, 3), Decl(arrowFunctionExpressions.ts, 6, 3))
2014-08-15 23:33:16 +02:00
>(j) => { return 0; } : (j: any) => number
2015-04-13 23:01:57 +02:00
>j : any, Symbol(j, Decl(arrowFunctionExpressions.ts, 6, 9))
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
// Identifier => AssignmentExpression is equivalent to(Identifier) => AssignmentExpression
var c: number;
2015-04-13 23:01:57 +02:00
>c : number, Symbol(c, Decl(arrowFunctionExpressions.ts, 9, 3))
2014-08-15 23:33:16 +02:00
var d = n => c = n;
2015-04-13 23:01:57 +02:00
>d : (n: any) => any, Symbol(d, Decl(arrowFunctionExpressions.ts, 10, 3), Decl(arrowFunctionExpressions.ts, 11, 3), Decl(arrowFunctionExpressions.ts, 12, 3))
2014-08-15 23:33:16 +02:00
>n => c = n : (n: any) => any
2015-04-13 23:01:57 +02:00
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 10, 7))
2014-08-15 23:33:16 +02:00
>c = n : any
2015-04-13 23:01:57 +02:00
>c : number, Symbol(c, Decl(arrowFunctionExpressions.ts, 9, 3))
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 10, 7))
2014-08-15 23:33:16 +02:00
var d = (n) => c = n;
2015-04-13 23:01:57 +02:00
>d : (n: any) => any, Symbol(d, Decl(arrowFunctionExpressions.ts, 10, 3), Decl(arrowFunctionExpressions.ts, 11, 3), Decl(arrowFunctionExpressions.ts, 12, 3))
2014-08-15 23:33:16 +02:00
>(n) => c = n : (n: any) => any
2015-04-13 23:01:57 +02:00
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 11, 9))
2014-08-15 23:33:16 +02:00
>c = n : any
2015-04-13 23:01:57 +02:00
>c : number, Symbol(c, Decl(arrowFunctionExpressions.ts, 9, 3))
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 11, 9))
2014-08-15 23:33:16 +02:00
var d: (n: any) => any;
2015-04-13 23:01:57 +02:00
>d : (n: any) => any, Symbol(d, Decl(arrowFunctionExpressions.ts, 10, 3), Decl(arrowFunctionExpressions.ts, 11, 3), Decl(arrowFunctionExpressions.ts, 12, 3))
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 12, 8))
2014-08-15 23:33:16 +02:00
// Binding patterns in arrow functions
var p1 = ([a]) => { };
2015-04-13 23:01:57 +02:00
>p1 : ([a]: [any]) => void, Symbol(p1, Decl(arrowFunctionExpressions.ts, 15, 3))
>([a]) => { } : ([a]: [any]) => void
2015-04-13 23:01:57 +02:00
>a : any, Symbol(a, Decl(arrowFunctionExpressions.ts, 15, 11))
var p2 = ([...a]) => { };
2015-04-13 23:01:57 +02:00
>p2 : ([...a]: any[]) => void, Symbol(p2, Decl(arrowFunctionExpressions.ts, 16, 3))
>([...a]) => { } : ([...a]: any[]) => void
2015-04-13 23:01:57 +02:00
>a : any[], Symbol(a, Decl(arrowFunctionExpressions.ts, 16, 11))
var p3 = ([, a]) => { };
2015-04-13 23:01:57 +02:00
>p3 : ([, a]: [any, any]) => void, Symbol(p3, Decl(arrowFunctionExpressions.ts, 17, 3))
>([, a]) => { } : ([, a]: [any, any]) => void
2015-04-13 21:36:11 +02:00
> : undefined
2015-04-13 23:01:57 +02:00
>a : any, Symbol(a, Decl(arrowFunctionExpressions.ts, 17, 12))
var p4 = ([, ...a]) => { };
2015-04-13 23:01:57 +02:00
>p4 : ([, ...a]: any[]) => void, Symbol(p4, Decl(arrowFunctionExpressions.ts, 18, 3))
>([, ...a]) => { } : ([, ...a]: any[]) => void
2015-04-13 21:36:11 +02:00
> : undefined
2015-04-13 23:01:57 +02:00
>a : any[], Symbol(a, Decl(arrowFunctionExpressions.ts, 18, 12))
var p5 = ([a = 1]) => { };
2015-04-13 23:01:57 +02:00
>p5 : ([a = 1]: [number]) => void, Symbol(p5, Decl(arrowFunctionExpressions.ts, 19, 3))
>([a = 1]) => { } : ([a = 1]: [number]) => void
2015-04-13 23:01:57 +02:00
>a : number, Symbol(a, Decl(arrowFunctionExpressions.ts, 19, 11))
2015-04-13 21:36:11 +02:00
>1 : number
var p6 = ({ a }) => { };
2015-04-13 23:01:57 +02:00
>p6 : ({ a }: { a: any; }) => void, Symbol(p6, Decl(arrowFunctionExpressions.ts, 20, 3))
>({ a }) => { } : ({ a }: { a: any; }) => void
2015-04-13 23:01:57 +02:00
>a : any, Symbol(a, Decl(arrowFunctionExpressions.ts, 20, 11))
var p7 = ({ a: { b } }) => { };
2015-04-13 23:01:57 +02:00
>p7 : ({ a: { b } }: { a: { b: any; }; }) => void, Symbol(p7, Decl(arrowFunctionExpressions.ts, 21, 3))
>({ a: { b } }) => { } : ({ a: { b } }: { a: { b: any; }; }) => void
>a : any
2015-04-13 23:01:57 +02:00
>b : any, Symbol(b, Decl(arrowFunctionExpressions.ts, 21, 16))
var p8 = ({ a = 1 }) => { };
2015-04-13 23:01:57 +02:00
>p8 : ({ a = 1 }: { a?: number; }) => void, Symbol(p8, Decl(arrowFunctionExpressions.ts, 22, 3))
>({ a = 1 }) => { } : ({ a = 1 }: { a?: number; }) => void
2015-04-13 23:01:57 +02:00
>a : number, Symbol(a, Decl(arrowFunctionExpressions.ts, 22, 11))
2015-04-13 21:36:11 +02:00
>1 : number
var p9 = ({ a: { b = 1 } = { b: 1 } }) => { };
2015-04-13 23:01:57 +02:00
>p9 : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void, Symbol(p9, Decl(arrowFunctionExpressions.ts, 23, 3))
>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b = 1 } = { b: 1 } }: { a?: { b: number; }; }) => void
>a : any
2015-04-13 23:01:57 +02:00
>b : number, Symbol(b, Decl(arrowFunctionExpressions.ts, 23, 16))
2015-04-13 21:36:11 +02:00
>1 : number
>{ b: 1 } : { b: number; }
2015-04-13 23:01:57 +02:00
>b : number, Symbol(b, Decl(arrowFunctionExpressions.ts, 23, 28))
2015-04-13 21:36:11 +02:00
>1 : number
var p10 = ([{ value, done }]) => { };
2015-04-13 23:01:57 +02:00
>p10 : ([{ value, done }]: [{ value: any; done: any; }]) => void, Symbol(p10, Decl(arrowFunctionExpressions.ts, 24, 3))
>([{ value, done }]) => { } : ([{ value, done }]: [{ value: any; done: any; }]) => void
2015-04-13 23:01:57 +02:00
>value : any, Symbol(value, Decl(arrowFunctionExpressions.ts, 24, 13))
>done : any, Symbol(done, Decl(arrowFunctionExpressions.ts, 24, 20))
2014-08-15 23:33:16 +02:00
// Arrow function used in class member initializer
// Arrow function used in class member function
class MyClass {
2015-04-13 23:01:57 +02:00
>MyClass : MyClass, Symbol(MyClass, Decl(arrowFunctionExpressions.ts, 24, 37))
2014-08-15 23:33:16 +02:00
m = (n) => n + 1;
2015-04-13 23:01:57 +02:00
>m : (n: any) => any, Symbol(m, Decl(arrowFunctionExpressions.ts, 28, 15))
2014-08-15 23:33:16 +02:00
>(n) => n + 1 : (n: any) => any
2015-04-13 23:01:57 +02:00
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 29, 9))
2014-08-15 23:33:16 +02:00
>n + 1 : any
2015-04-13 23:01:57 +02:00
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 29, 9))
2015-04-13 21:36:11 +02:00
>1 : number
2014-08-15 23:33:16 +02:00
p = (n) => n && this;
2015-04-13 23:01:57 +02:00
>p : (n: any) => MyClass, Symbol(p, Decl(arrowFunctionExpressions.ts, 29, 21))
2014-08-15 23:33:16 +02:00
>(n) => n && this : (n: any) => MyClass
2015-04-13 23:01:57 +02:00
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 30, 9))
2014-08-15 23:33:16 +02:00
>n && this : MyClass
2015-04-13 23:01:57 +02:00
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 30, 9))
>this : MyClass, Symbol(MyClass, Decl(arrowFunctionExpressions.ts, 24, 37))
2014-08-15 23:33:16 +02:00
fn() {
2015-04-13 23:01:57 +02:00
>fn : () => void, Symbol(fn, Decl(arrowFunctionExpressions.ts, 30, 25))
2014-08-15 23:33:16 +02:00
var m = (n) => n + 1;
2015-04-13 23:01:57 +02:00
>m : (n: any) => any, Symbol(m, Decl(arrowFunctionExpressions.ts, 33, 11))
2014-08-15 23:33:16 +02:00
>(n) => n + 1 : (n: any) => any
2015-04-13 23:01:57 +02:00
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 33, 17))
2014-08-15 23:33:16 +02:00
>n + 1 : any
2015-04-13 23:01:57 +02:00
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 33, 17))
2015-04-13 21:36:11 +02:00
>1 : number
2014-08-15 23:33:16 +02:00
var p = (n) => n && this;
2015-04-13 23:01:57 +02:00
>p : (n: any) => MyClass, Symbol(p, Decl(arrowFunctionExpressions.ts, 34, 11))
2014-08-15 23:33:16 +02:00
>(n) => n && this : (n: any) => MyClass
2015-04-13 23:01:57 +02:00
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 34, 17))
2014-08-15 23:33:16 +02:00
>n && this : MyClass
2015-04-13 23:01:57 +02:00
>n : any, Symbol(n, Decl(arrowFunctionExpressions.ts, 34, 17))
>this : MyClass, Symbol(MyClass, Decl(arrowFunctionExpressions.ts, 24, 37))
2014-08-15 23:33:16 +02:00
}
}
// Arrow function used in arrow function
var arrrr = () => (m: number) => () => (n: number) => m + n;
2015-04-13 23:01:57 +02:00
>arrrr : () => (m: number) => () => (n: number) => number, Symbol(arrrr, Decl(arrowFunctionExpressions.ts, 39, 3))
2014-08-15 23:33:16 +02:00
>() => (m: number) => () => (n: number) => m + n : () => (m: number) => () => (n: number) => number
>(m: number) => () => (n: number) => m + n : (m: number) => () => (n: number) => number
2015-04-13 23:01:57 +02:00
>m : number, Symbol(m, Decl(arrowFunctionExpressions.ts, 39, 19))
2014-08-15 23:33:16 +02:00
>() => (n: number) => m + n : () => (n: number) => number
>(n: number) => m + n : (n: number) => number
2015-04-13 23:01:57 +02:00
>n : number, Symbol(n, Decl(arrowFunctionExpressions.ts, 39, 40))
2014-08-15 23:33:16 +02:00
>m + n : number
2015-04-13 23:01:57 +02:00
>m : number, Symbol(m, Decl(arrowFunctionExpressions.ts, 39, 19))
>n : number, Symbol(n, Decl(arrowFunctionExpressions.ts, 39, 40))
2014-08-15 23:33:16 +02:00
var e = arrrr()(3)()(4);
2015-04-13 23:01:57 +02:00
>e : number, Symbol(e, Decl(arrowFunctionExpressions.ts, 40, 3), Decl(arrowFunctionExpressions.ts, 41, 3))
2014-08-15 23:33:16 +02:00
>arrrr()(3)()(4) : number
>arrrr()(3)() : (n: number) => number
>arrrr()(3) : () => (n: number) => number
>arrrr() : (m: number) => () => (n: number) => number
2015-04-13 23:01:57 +02:00
>arrrr : () => (m: number) => () => (n: number) => number, Symbol(arrrr, Decl(arrowFunctionExpressions.ts, 39, 3))
2015-04-13 21:36:11 +02:00
>3 : number
>4 : number
2014-08-15 23:33:16 +02:00
var e: number;
2015-04-13 23:01:57 +02:00
>e : number, Symbol(e, Decl(arrowFunctionExpressions.ts, 40, 3), Decl(arrowFunctionExpressions.ts, 41, 3))
2014-08-15 23:33:16 +02:00
// Arrow function used in arrow function used in function
function someFn() {
2015-04-13 23:01:57 +02:00
>someFn : () => void, Symbol(someFn, Decl(arrowFunctionExpressions.ts, 41, 14))
2014-08-15 23:33:16 +02:00
var arr = (n: number) => (p: number) => p * n;
2015-04-13 23:01:57 +02:00
>arr : (n: number) => (p: number) => number, Symbol(arr, Decl(arrowFunctionExpressions.ts, 45, 7))
2014-08-15 23:33:16 +02:00
>(n: number) => (p: number) => p * n : (n: number) => (p: number) => number
2015-04-13 23:01:57 +02:00
>n : number, Symbol(n, Decl(arrowFunctionExpressions.ts, 45, 15))
2014-08-15 23:33:16 +02:00
>(p: number) => p * n : (p: number) => number
2015-04-13 23:01:57 +02:00
>p : number, Symbol(p, Decl(arrowFunctionExpressions.ts, 45, 30))
2014-08-15 23:33:16 +02:00
>p * n : number
2015-04-13 23:01:57 +02:00
>p : number, Symbol(p, Decl(arrowFunctionExpressions.ts, 45, 30))
>n : number, Symbol(n, Decl(arrowFunctionExpressions.ts, 45, 15))
2014-08-15 23:33:16 +02:00
arr(3)(4).toExponential();
>arr(3)(4).toExponential() : string
2015-04-13 23:01:57 +02:00
>arr(3)(4).toExponential : (fractionDigits?: number) => string, Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45))
2014-08-15 23:33:16 +02:00
>arr(3)(4) : number
>arr(3) : (p: number) => number
2015-04-13 23:01:57 +02:00
>arr : (n: number) => (p: number) => number, Symbol(arr, Decl(arrowFunctionExpressions.ts, 45, 7))
2015-04-13 21:36:11 +02:00
>3 : number
>4 : number
2015-04-13 23:01:57 +02:00
>toExponential : (fractionDigits?: number) => string, Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45))
2014-08-15 23:33:16 +02:00
}
// Arrow function used in function
function someOtherFn() {
2015-04-13 23:01:57 +02:00
>someOtherFn : () => void, Symbol(someOtherFn, Decl(arrowFunctionExpressions.ts, 47, 1))
2014-08-15 23:33:16 +02:00
var arr = (n: number) => '' + n;
2015-04-13 23:01:57 +02:00
>arr : (n: number) => string, Symbol(arr, Decl(arrowFunctionExpressions.ts, 51, 7))
2014-08-15 23:33:16 +02:00
>(n: number) => '' + n : (n: number) => string
2015-04-13 23:01:57 +02:00
>n : number, Symbol(n, Decl(arrowFunctionExpressions.ts, 51, 15))
2014-08-15 23:33:16 +02:00
>'' + n : string
2015-04-13 21:36:11 +02:00
>'' : string
2015-04-13 23:01:57 +02:00
>n : number, Symbol(n, Decl(arrowFunctionExpressions.ts, 51, 15))
2014-08-15 23:33:16 +02:00
arr(4).charAt(0);
>arr(4).charAt(0) : string
2015-04-13 23:01:57 +02:00
>arr(4).charAt : (pos: number) => string, Symbol(String.charAt, Decl(lib.d.ts, 279, 23))
2014-08-15 23:33:16 +02:00
>arr(4) : string
2015-04-13 23:01:57 +02:00
>arr : (n: number) => string, Symbol(arr, Decl(arrowFunctionExpressions.ts, 51, 7))
2015-04-13 21:36:11 +02:00
>4 : number
2015-04-13 23:01:57 +02:00
>charAt : (pos: number) => string, Symbol(String.charAt, Decl(lib.d.ts, 279, 23))
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
}
// Arrow function used in nested function in function
function outerFn() {
2015-04-13 23:01:57 +02:00
>outerFn : () => void, Symbol(outerFn, Decl(arrowFunctionExpressions.ts, 53, 1))
2014-08-15 23:33:16 +02:00
function innerFn() {
2015-04-13 23:01:57 +02:00
>innerFn : () => void, Symbol(innerFn, Decl(arrowFunctionExpressions.ts, 56, 20))
2014-08-15 23:33:16 +02:00
var arrowFn = () => { };
2015-04-13 23:01:57 +02:00
>arrowFn : () => void, Symbol(arrowFn, Decl(arrowFunctionExpressions.ts, 58, 11))
2014-08-15 23:33:16 +02:00
>() => { } : () => void
var p = arrowFn();
2015-04-13 23:01:57 +02:00
>p : void, Symbol(p, Decl(arrowFunctionExpressions.ts, 59, 11), Decl(arrowFunctionExpressions.ts, 60, 11))
2014-08-15 23:33:16 +02:00
>arrowFn() : void
2015-04-13 23:01:57 +02:00
>arrowFn : () => void, Symbol(arrowFn, Decl(arrowFunctionExpressions.ts, 58, 11))
2014-08-15 23:33:16 +02:00
var p: void;
2015-04-13 23:01:57 +02:00
>p : void, Symbol(p, Decl(arrowFunctionExpressions.ts, 59, 11), Decl(arrowFunctionExpressions.ts, 60, 11))
2014-08-15 23:33:16 +02:00
}
}
// Arrow function used in nested function in arrow function
var f = (n: string) => {
2015-04-13 23:01:57 +02:00
>f : (n: string) => () => string, Symbol(f, Decl(arrowFunctionExpressions.ts, 65, 3))
2014-08-22 03:39:46 +02:00
>(n: string) => { function fn(x: number) { return () => n + x; } return fn(4);} : (n: string) => () => string
2015-04-13 23:01:57 +02:00
>n : string, Symbol(n, Decl(arrowFunctionExpressions.ts, 65, 9))
2014-08-15 23:33:16 +02:00
function fn(x: number) {
2015-04-13 23:01:57 +02:00
>fn : (x: number) => () => string, Symbol(fn, Decl(arrowFunctionExpressions.ts, 65, 24))
>x : number, Symbol(x, Decl(arrowFunctionExpressions.ts, 66, 16))
2014-08-15 23:33:16 +02:00
return () => n + x;
>() => n + x : () => string
>n + x : string
2015-04-13 23:01:57 +02:00
>n : string, Symbol(n, Decl(arrowFunctionExpressions.ts, 65, 9))
>x : number, Symbol(x, Decl(arrowFunctionExpressions.ts, 66, 16))
2014-08-15 23:33:16 +02:00
}
return fn(4);
>fn(4) : () => string
2015-04-13 23:01:57 +02:00
>fn : (x: number) => () => string, Symbol(fn, Decl(arrowFunctionExpressions.ts, 65, 24))
2015-04-13 21:36:11 +02:00
>4 : number
2014-08-15 23:33:16 +02:00
}
var g = f('')();
2015-04-13 23:01:57 +02:00
>g : string, Symbol(g, Decl(arrowFunctionExpressions.ts, 71, 3), Decl(arrowFunctionExpressions.ts, 72, 3))
2014-08-15 23:33:16 +02:00
>f('')() : string
>f('') : () => string
2015-04-13 23:01:57 +02:00
>f : (n: string) => () => string, Symbol(f, Decl(arrowFunctionExpressions.ts, 65, 3))
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
var g: string;
2015-04-13 23:01:57 +02:00
>g : string, Symbol(g, Decl(arrowFunctionExpressions.ts, 71, 3), Decl(arrowFunctionExpressions.ts, 72, 3))
2014-08-15 23:33:16 +02:00
// Arrow function used in nested function in arrow function in nested function
function someOuterFn() {
2015-04-13 23:01:57 +02:00
>someOuterFn : () => (n: string) => () => () => number, Symbol(someOuterFn, Decl(arrowFunctionExpressions.ts, 72, 14))
2014-08-15 23:33:16 +02:00
var arr = (n: string) => {
2015-04-13 23:01:57 +02:00
>arr : (n: string) => () => () => number, Symbol(arr, Decl(arrowFunctionExpressions.ts, 77, 7))
2014-08-22 03:39:46 +02:00
>(n: string) => { function innerFn() { return () => n.length; } return innerFn; } : (n: string) => () => () => number
2015-04-13 23:01:57 +02:00
>n : string, Symbol(n, Decl(arrowFunctionExpressions.ts, 77, 15))
2014-08-15 23:33:16 +02:00
function innerFn() {
2015-04-13 23:01:57 +02:00
>innerFn : () => () => number, Symbol(innerFn, Decl(arrowFunctionExpressions.ts, 77, 30))
2014-08-15 23:33:16 +02:00
return () => n.length;
>() => n.length : () => number
2015-04-13 23:01:57 +02:00
>n.length : number, Symbol(String.length, Decl(lib.d.ts, 414, 19))
>n : string, Symbol(n, Decl(arrowFunctionExpressions.ts, 77, 15))
>length : number, Symbol(String.length, Decl(lib.d.ts, 414, 19))
2014-08-15 23:33:16 +02:00
}
return innerFn;
2015-04-13 23:01:57 +02:00
>innerFn : () => () => number, Symbol(innerFn, Decl(arrowFunctionExpressions.ts, 77, 30))
2014-08-15 23:33:16 +02:00
}
return arr;
2015-04-13 23:01:57 +02:00
>arr : (n: string) => () => () => number, Symbol(arr, Decl(arrowFunctionExpressions.ts, 77, 7))
2014-08-15 23:33:16 +02:00
}
var h = someOuterFn()('')()();
2015-04-13 23:01:57 +02:00
>h : number, Symbol(h, Decl(arrowFunctionExpressions.ts, 85, 3))
2014-08-15 23:33:16 +02:00
>someOuterFn()('')()() : number
>someOuterFn()('')() : () => number
>someOuterFn()('') : () => () => number
>someOuterFn() : (n: string) => () => () => number
2015-04-13 23:01:57 +02:00
>someOuterFn : () => (n: string) => () => () => number, Symbol(someOuterFn, Decl(arrowFunctionExpressions.ts, 72, 14))
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
h.toExponential();
>h.toExponential() : string
2015-04-13 23:01:57 +02:00
>h.toExponential : (fractionDigits?: number) => string, Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45))
>h : number, Symbol(h, Decl(arrowFunctionExpressions.ts, 85, 3))
>toExponential : (fractionDigits?: number) => string, Symbol(Number.toExponential, Decl(lib.d.ts, 469, 45))
2014-08-15 23:33:16 +02:00
// Arrow function used in try/catch/finally in function
function tryCatchFn() {
2015-04-13 23:01:57 +02:00
>tryCatchFn : () => void, Symbol(tryCatchFn, Decl(arrowFunctionExpressions.ts, 86, 18))
2014-08-15 23:33:16 +02:00
try {
var x = () => this;
2015-04-13 23:01:57 +02:00
>x : () => any, Symbol(x, Decl(arrowFunctionExpressions.ts, 91, 11))
2014-08-15 23:33:16 +02:00
>() => this : () => any
>this : any
} catch (e) {
2015-04-13 23:01:57 +02:00
>e : any, Symbol(e, Decl(arrowFunctionExpressions.ts, 92, 13))
2014-08-15 23:33:16 +02:00
var t = () => e + this;
2015-04-13 23:01:57 +02:00
>t : () => any, Symbol(t, Decl(arrowFunctionExpressions.ts, 93, 11))
2014-08-15 23:33:16 +02:00
>() => e + this : () => any
>e + this : any
2015-04-13 23:01:57 +02:00
>e : any, Symbol(e, Decl(arrowFunctionExpressions.ts, 92, 13))
2014-08-15 23:33:16 +02:00
>this : any
} finally {
var m = () => this + '';
2015-04-13 23:01:57 +02:00
>m : () => string, Symbol(m, Decl(arrowFunctionExpressions.ts, 95, 11))
2014-08-15 23:33:16 +02:00
>() => this + '' : () => string
>this + '' : string
>this : any
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
}
}