Skip to content

Commit 6aa2427

Browse files
committed
add test for issue 10843
1 parent 9ff425b commit 6aa2427

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//// [findIndex.ts]
2+
3+
[].findIndex(function(elem, i, arr) {
4+
return true;
5+
});
6+
7+
//// [findIndex.js]
8+
[].findIndex(function (elem, i, arr) {
9+
return true;
10+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
=== tests/cases/conformance/es6/arrayMethods/findIndex.ts ===
2+
3+
[].findIndex(function(elem, i, arr) {
4+
>[].findIndex : Symbol(Array.findIndex, Decl(lib.es2015.core.d.ts, --, --))
5+
>findIndex : Symbol(Array.findIndex, Decl(lib.es2015.core.d.ts, --, --))
6+
>elem : Symbol(elem, Decl(findIndex.ts, 1, 22))
7+
>i : Symbol(i, Decl(findIndex.ts, 1, 27))
8+
>arr : Symbol(arr, Decl(findIndex.ts, 1, 30))
9+
10+
return true;
11+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
=== tests/cases/conformance/es6/arrayMethods/findIndex.ts ===
2+
3+
[].findIndex(function(elem, i, arr) {
4+
>[].findIndex(function(elem, i, arr) { return true;}) : number
5+
>[].findIndex : (predicate: (value: any, index: number, obj: any[]) => boolean, thisArg?: any) => number
6+
>[] : undefined[]
7+
>findIndex : (predicate: (value: any, index: number, obj: any[]) => boolean, thisArg?: any) => number
8+
>function(elem, i, arr) { return true;} : (elem: any, i: number, arr: any[]) => boolean
9+
>elem : any
10+
>i : number
11+
>arr : any[]
12+
13+
return true;
14+
>true : boolean
15+
16+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@target: ES6
2+
3+
[].findIndex(function(elem, i, arr) {
4+
return true;
5+
});

0 commit comments

Comments
 (0)