Commit b26ec48
authored
Fixed out of spec behavior of array.reduce (#731)
* Fixed out of spec behavior of array.reduce
* Moved select declarations from ArrayReduce to lualib declaration files
* Fixed issue in reduce with undefined returning callback
* Changed reduce loop from while to for for performance reasons
* Cleaned up code a little from PR feedback
* testcase formatting1 parent c1e77c9 commit b26ec48Copy full SHA for b26ec48
4 files changed
+38-12Lines changed: 38 additions & 12 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- src/lualib
- declarations
- test/unit/builtins
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+13-12Lines changed: 13 additions & 12 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
6 | | - |
| 6 | + |
7 | 7 | |
8 | 8 | |
9 | 9 | |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | 10 | |
16 | | - |
17 | | - |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
18 | 17 | |
19 | | - |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
20 | 22 | |
21 | 23 | |
22 | | - |
23 | | - |
24 | | - |
| 24 | + |
| 25 | + |
25 | 26 | |
26 | 27 | |
27 | 28 | |
|
Collapse file
src/lualib/declarations/global.d.ts
Copy file name to clipboardExpand all lines: src/lualib/declarations/global.d.ts+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
16 | 16 | |
17 | 17 | |
18 | 18 | |
| 19 | + |
| 20 | + |
| 21 | + |
Collapse file
src/lualib/declarations/tstl.d.ts
Copy file name to clipboardExpand all lines: src/lualib/declarations/tstl.d.ts+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
3 | 9 | |
4 | 10 | |
5 | 11 | |
|
Collapse file
test/unit/builtins/array.spec.ts
Copy file name to clipboardExpand all lines: test/unit/builtins/array.spec.ts+16Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
486 | 486 | |
487 | 487 | |
488 | 488 | |
| 489 | + |
| 490 | + |
| 491 | + |
| 492 | + |
| 493 | + |
| 494 | + |
| 495 | + |
| 496 | + |
| 497 | + |
| 498 | + |
| 499 | + |
| 500 | + |
| 501 | + |
| 502 | + |
| 503 | + |
| 504 | + |
489 | 505 | |
490 | 506 | |
491 | 507 | |
|
0 commit comments