Skip to content

Commit 418a27c

Browse files
authored
Enable by default findLast and findLastIndex methods (#6769)
This PR enables previously flagged findLast and findLastIndex methods of Array.prototype since respective proposal has reached stage 3 and updates and merges tests accordingly. Fixes #6661.
1 parent 44bf6e7 commit 418a27c

10 files changed

+132
-128
lines changed

lib/Common/ConfigFlagsList.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ PHASE(All)
670670
#define DEFAULT_CONFIG_ESNumericSeparator (true)
671671
#define DEFAULT_CONFIG_ESHashbang (true)
672672
#define DEFAULT_CONFIG_ESSymbolDescription (true)
673-
#define DEFAULT_CONFIG_ESArrayFindFromLast (false)
673+
#define DEFAULT_CONFIG_ESArrayFindFromLast (true)
674674
#define DEFAULT_CONFIG_ESPromiseAny (true)
675675
#define DEFAULT_CONFIG_ESNullishCoalescingOperator (true)
676676
#define DEFAULT_CONFIG_ESGlobalThis (true)

test/Array/rlexe.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
<test>
2222
<default>
2323
<files>array_findlast.js</files>
24-
<compile-flags>-ESArrayFindFromLast -args summary -endargs</compile-flags>
24+
<compile-flags>-args summary -endargs</compile-flags>
2525
</default>
2626
</test>
2727
<test>
2828
<default>
2929
<files>array_findlastindex.js</files>
30-
<compile-flags>-ESArrayFindFromLast -args summary -endargs</compile-flags>
30+
<compile-flags>-args summary -endargs</compile-flags>
3131
</default>
3232
</test>
3333
<test>

test/DebuggerCommon/ES6_proto_invalidation.js.dbg.baseline

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,21 @@
398398
"length": "number 1",
399399
"name": "string find"
400400
},
401+
"findLast": {
402+
"#__proto__": "function <large string>",
403+
"length": "number 1",
404+
"name": "string findLast"
405+
},
401406
"findIndex": {
402407
"#__proto__": "function <large string>",
403408
"length": "number 1",
404409
"name": "string findIndex"
405410
},
411+
"findLastIndex": {
412+
"#__proto__": "function <large string>",
413+
"length": "number 1",
414+
"name": "string findLastIndex"
415+
},
406416
"keys": {
407417
"#__proto__": "function <large string>",
408418
"length": "number 0",
@@ -454,7 +464,9 @@
454464
"entries": "boolean true",
455465
"fill": "boolean true",
456466
"find": "boolean true",
467+
"findLast": "boolean true",
457468
"findIndex": "boolean true",
469+
"findLastIndex": "boolean true",
458470
"flat": "boolean true",
459471
"flatMap": "boolean true",
460472
"includes": "boolean true",
@@ -633,11 +645,21 @@
633645
"length": "number 1",
634646
"name": "string find"
635647
},
648+
"findLast": {
649+
"#__proto__": "function <large string>",
650+
"length": "number 1",
651+
"name": "string findLast"
652+
},
636653
"findIndex": {
637654
"#__proto__": "function <large string>",
638655
"length": "number 1",
639656
"name": "string findIndex"
640657
},
658+
"findLastIndex": {
659+
"#__proto__": "function <large string>",
660+
"length": "number 1",
661+
"name": "string findLastIndex"
662+
},
641663
"keys": {
642664
"#__proto__": "function <large string>",
643665
"length": "number 0",
@@ -689,7 +711,9 @@
689711
"entries": "boolean true",
690712
"fill": "boolean true",
691713
"find": "boolean true",
714+
"findLast": "boolean true",
692715
"findIndex": "boolean true",
716+
"findLastIndex": "boolean true",
693717
"flat": "boolean true",
694718
"flatMap": "boolean true",
695719
"includes": "boolean true",

test/DebuggerCommon/TypedArray.js.dbg.baseline

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"fill": "function function fill() { [native code] }",
3030
"filter": "function function filter() { [native code] }",
3131
"find": "function function find() { [native code] }",
32+
"findLast": "function function findLast() { [native code] }",
3233
"findIndex": "function function findIndex() { [native code] }",
34+
"findLastIndex": "function function findLastIndex() { [native code] }",
3335
"forEach": "function function forEach() { [native code] }",
3436
"indexOf": "function function indexOf() { [native code] }",
3537
"join": "function function join() { [native code] }",
@@ -87,7 +89,9 @@
8789
"fill": "function function fill() { [native code] }",
8890
"filter": "function function filter() { [native code] }",
8991
"find": "function function find() { [native code] }",
92+
"findLast": "function function findLast() { [native code] }",
9093
"findIndex": "function function findIndex() { [native code] }",
94+
"findLastIndex": "function function findLastIndex() { [native code] }",
9195
"forEach": "function function forEach() { [native code] }",
9296
"indexOf": "function function indexOf() { [native code] }",
9397
"join": "function function join() { [native code] }",
@@ -139,7 +143,9 @@
139143
"fill": "function function fill() { [native code] }",
140144
"filter": "function function filter() { [native code] }",
141145
"find": "function function find() { [native code] }",
146+
"findLast": "function function findLast() { [native code] }",
142147
"findIndex": "function function findIndex() { [native code] }",
148+
"findLastIndex": "function function findLastIndex() { [native code] }",
143149
"forEach": "function function forEach() { [native code] }",
144150
"indexOf": "function function indexOf() { [native code] }",
145151
"join": "function function join() { [native code] }",

test/DebuggerCommon/array_prototest.js.dbg.baseline

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@
8383
"reduceRight": "function <large string>",
8484
"some": "function <large string>",
8585
"find": "function <large string>",
86+
"findLast": "function <large string>",
8687
"findIndex": "function <large string>",
88+
"findLastIndex": "function <large string>",
8789
"keys": "function <large string>",
8890
"values": "function <large string>",
8991
"Symbol.iterator": "function <large string>",
@@ -127,7 +129,9 @@
127129
"reduceRight": "function <large string>",
128130
"some": "function <large string>",
129131
"find": "function <large string>",
132+
"findLast": "function <large string>",
130133
"findIndex": "function <large string>",
134+
"findLastIndex": "function <large string>",
131135
"keys": "function <large string>",
132136
"values": "function <large string>",
133137
"Symbol.iterator": "function <large string>",
@@ -172,7 +176,9 @@
172176
"reduceRight": "function <large string>",
173177
"some": "function <large string>",
174178
"find": "function <large string>",
179+
"findLast": "function <large string>",
175180
"findIndex": "function <large string>",
181+
"findLastIndex": "function <large string>",
176182
"keys": "function <large string>",
177183
"values": "function <large string>",
178184
"Symbol.iterator": "function <large string>",
@@ -314,7 +320,9 @@
314320
"reduceRight": "function <large string>",
315321
"some": "function <large string>",
316322
"find": "function <large string>",
323+
"findLast": "function <large string>",
317324
"findIndex": "function <large string>",
325+
"findLastIndex": "function <large string>",
318326
"keys": "function <large string>",
319327
"values": "function <large string>",
320328
"Symbol.iterator": "function <large string>",
@@ -358,7 +366,9 @@
358366
"reduceRight": "function <large string>",
359367
"some": "function <large string>",
360368
"find": "function <large string>",
369+
"findLast": "function <large string>",
361370
"findIndex": "function <large string>",
371+
"findLastIndex": "function <large string>",
362372
"keys": "function <large string>",
363373
"values": "function <large string>",
364374
"Symbol.iterator": "function <large string>",
@@ -404,7 +414,9 @@
404414
"reduceRight": "function <large string>",
405415
"some": "function <large string>",
406416
"find": "function <large string>",
417+
"findLast": "function <large string>",
407418
"findIndex": "function <large string>",
419+
"findLastIndex": "function <large string>",
408420
"keys": "function <large string>",
409421
"values": "function <large string>",
410422
"Symbol.iterator": "function <large string>",

test/DebuggerCommon/indexprop.js.dbg.baseline

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@
5959
"reduceRight": "function <large string>",
6060
"some": "function <large string>",
6161
"find": "function <large string>",
62+
"findLast": "function <large string>",
6263
"findIndex": "function <large string>",
64+
"findLastIndex": "function <large string>",
6365
"Symbol.unscopables": "Object {...}",
6466
"fill": "function <large string>",
6567
"copyWithin": "function <large string>",

test/DebuggerCommon/step_in_from_interpreted_function_attach.js.dbg.baseline

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@
162162
"reduceRight": "function <large string>",
163163
"some": "function <large string>",
164164
"find": "function <large string>",
165+
"findLast": "function <large string>",
165166
"findIndex": "function <large string>",
167+
"findLastIndex": "function <large string>",
166168
"Symbol.unscopables": "Object {...}",
167169
"fill": "function <large string>",
168170
"copyWithin": "function <large string>",

test/es6/rlexe.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,6 @@
100100
<compile-flags>-args summary -endargs</compile-flags>
101101
</default>
102102
</test>
103-
<test>
104-
<default>
105-
<files>unscopablesWithEsArrayFindFromLastTest.js</files>
106-
<compile-flags>-ESArrayFindFromLast -args summary -endargs</compile-flags>
107-
</default>
108-
</test>
109103
<test>
110104
<default>
111105
<files>function.name.js</files>

test/es6/unscopablesWithEsArrayFindFromLastTest.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)