Commit 28397f4
authored
Added support for reduceRight (#732)
* 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 formatting
* Added reduceRight
* Added tests, fixed implementation
* Changed test structure for reduce to describe
* Removed duplicate test1 parent b7e7296 commit 28397f4
File tree
4 files changed
+56
-22
lines changed- src
- lualib
- test/unit/builtins
4 files changed
+56
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5130 | 5130 | | |
5131 | 5131 | | |
5132 | 5132 | | |
| 5133 | + | |
| 5134 | + | |
5133 | 5135 | | |
5134 | 5136 | | |
5135 | 5137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
520 | 521 | | |
521 | | - | |
522 | | - | |
523 | | - | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
524 | 525 | | |
525 | | - | |
526 | | - | |
527 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
528 | 529 | | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
535 | 537 | | |
536 | 538 | | |
537 | 539 | | |
| |||
0 commit comments