Title: [288538] trunk
Revision
288538
Author
[email protected]
Date
2022-01-24 21:38:35 -0800 (Mon, 24 Jan 2022)

Log Message

[JSC] Enable Array#groupBy and Array#groupByToMap
https://bugs.webkit.org/show_bug.cgi?id=235549

Reviewed by Ross Kirsling.

JSTests:

* stress/unscopables.js:

Source/_javascript_Core:

* runtime/OptionsList.h:

LayoutTests:

* inspector/model/remote-object-get-properties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/array-unscopables-properties-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/array-unscopables-properties.js:

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (288537 => 288538)


--- trunk/JSTests/ChangeLog	2022-01-25 05:13:18 UTC (rev 288537)
+++ trunk/JSTests/ChangeLog	2022-01-25 05:38:35 UTC (rev 288538)
@@ -1,5 +1,14 @@
 2022-01-24  Yusuke Suzuki  <[email protected]>
 
+        [JSC] Enable Array#groupBy and Array#groupByToMap
+        https://bugs.webkit.org/show_bug.cgi?id=235549
+
+        Reviewed by Ross Kirsling.
+
+        * stress/unscopables.js:
+
+2022-01-24  Yusuke Suzuki  <[email protected]>
+
         [JSC] Support import assertion syntax
         https://bugs.webkit.org/show_bug.cgi?id=235312
 

Modified: trunk/JSTests/stress/unscopables.js (288537 => 288538)


--- trunk/JSTests/stress/unscopables.js	2022-01-25 05:13:18 UTC (rev 288537)
+++ trunk/JSTests/stress/unscopables.js	2022-01-25 05:38:35 UTC (rev 288538)
@@ -11,7 +11,7 @@
 
     test(typeof unscopables, "object");
     test(unscopables.__proto__, undefined);
-    test(String(Object.keys(unscopables).sort()), "at,copyWithin,entries,fill,find,findIndex,findLast,findLastIndex,flat,flatMap,includes,keys,values");
+    test(String(Object.keys(unscopables).sort()), "at,copyWithin,entries,fill,find,findIndex,findLast,findLastIndex,flat,flatMap,groupBy,groupByToMap,includes,keys,values");
 }());
 
 (function () {

Modified: trunk/LayoutTests/ChangeLog (288537 => 288538)


--- trunk/LayoutTests/ChangeLog	2022-01-25 05:13:18 UTC (rev 288537)
+++ trunk/LayoutTests/ChangeLog	2022-01-25 05:38:35 UTC (rev 288538)
@@ -1,3 +1,16 @@
+2022-01-24  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Enable Array#groupBy and Array#groupByToMap
+        https://bugs.webkit.org/show_bug.cgi?id=235549
+
+        Reviewed by Ross Kirsling.
+
+        * inspector/model/remote-object-get-properties-expected.txt:
+        * js/Object-getOwnPropertyNames-expected.txt:
+        * js/array-unscopables-properties-expected.txt:
+        * js/script-tests/Object-getOwnPropertyNames.js:
+        * js/script-tests/array-unscopables-properties.js:
+
 2022-01-24  Patrick Angle  <[email protected]>
 
         Web Inspector: [Flexbox] Add instrumentation/protocol bits for flex layout containers

Modified: trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt (288537 => 288538)


--- trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt	2022-01-25 05:13:18 UTC (rev 288537)
+++ trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt	2022-01-25 05:38:35 UTC (rev 288538)
@@ -74,6 +74,8 @@
     indexOf
     lastIndexOf
     filter
+    groupBy
+    groupByToMap
     flat
     flatMap
     reduce
@@ -130,6 +132,8 @@
     indexOf
     lastIndexOf
     filter
+    groupBy
+    groupByToMap
     flat
     flatMap
     reduce
@@ -171,6 +175,8 @@
     indexOf
     lastIndexOf
     filter
+    groupBy
+    groupByToMap
     flat
     flatMap
     reduce
@@ -212,6 +218,8 @@
     indexOf
     lastIndexOf
     filter
+    groupBy
+    groupByToMap
     flat
     flatMap
     reduce

Modified: trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt (288537 => 288538)


--- trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt	2022-01-25 05:13:18 UTC (rev 288537)
+++ trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt	2022-01-25 05:38:35 UTC (rev 288538)
@@ -47,7 +47,7 @@
 PASS getSortedOwnPropertyNames(Function) is ['length', 'name', 'prototype']
 PASS getSortedOwnPropertyNames(Function.prototype) is ['apply', 'arguments', 'bind', 'call', 'caller', 'constructor', 'length', 'name', 'toString']
 PASS getSortedOwnPropertyNames(Array) is ['from', 'isArray', 'length', 'name', 'of', 'prototype']
-PASS getSortedOwnPropertyNames(Array.prototype) is ['at', 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'findLast', 'findLastIndex', 'flat', 'flatMap', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']
+PASS getSortedOwnPropertyNames(Array.prototype) is ['at', 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'findLast', 'findLastIndex', 'flat', 'flatMap', 'forEach', 'groupBy', 'groupByToMap', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']
 PASS getSortedOwnPropertyNames(String) is ['fromCharCode', 'fromCodePoint', 'length', 'name', 'prototype', 'raw']
 PASS getSortedOwnPropertyNames(String.prototype) is ['anchor', 'at', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'codePointAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'matchAll', 'normalize', 'padEnd', 'padStart', 'repeat', 'replace', 'replaceAll', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimEnd', 'trimLeft', 'trimRight', 'trimStart', 'valueOf']
 PASS getSortedOwnPropertyNames(Boolean) is ['length', 'name', 'prototype']

Modified: trunk/LayoutTests/js/array-unscopables-properties-expected.txt (288537 => 288538)


--- trunk/LayoutTests/js/array-unscopables-properties-expected.txt	2022-01-25 05:13:18 UTC (rev 288537)
+++ trunk/LayoutTests/js/array-unscopables-properties-expected.txt	2022-01-25 05:38:35 UTC (rev 288538)
@@ -50,6 +50,14 @@
 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "flatMap").writable is true
 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "flatMap").enumerable is true
 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "flatMap").configurable is true
+PASS Array.prototype[Symbol.unscopables]["groupBy"] is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "groupBy").writable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "groupBy").enumerable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "groupBy").configurable is true
+PASS Array.prototype[Symbol.unscopables]["groupByToMap"] is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "groupByToMap").writable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "groupByToMap").enumerable is true
+PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "groupByToMap").configurable is true
 PASS Array.prototype[Symbol.unscopables]["includes"] is true
 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "includes").writable is true
 PASS Object.getOwnPropertyDescriptor(Array.prototype[Symbol.unscopables], "includes").enumerable is true

Modified: trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js (288537 => 288538)


--- trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js	2022-01-25 05:13:18 UTC (rev 288537)
+++ trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js	2022-01-25 05:38:35 UTC (rev 288538)
@@ -56,7 +56,7 @@
     "Function": "['length', 'name', 'prototype']",
     "Function.prototype": "['apply', 'arguments', 'bind', 'call', 'caller', 'constructor', 'length', 'name', 'toString']",
     "Array": "['from', 'isArray', 'length', 'name', 'of', 'prototype']",
-    "Array.prototype": "['at', 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'findLast', 'findLastIndex', 'flat', 'flatMap', 'forEach', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']",
+    "Array.prototype": "['at', 'concat', 'constructor', 'copyWithin', 'entries', 'every', 'fill', 'filter', 'find', 'findIndex', 'findLast', 'findLastIndex', 'flat', 'flatMap', 'forEach', 'groupBy', 'groupByToMap', 'includes', 'indexOf', 'join', 'keys', 'lastIndexOf', 'length', 'map', 'pop', 'push', 'reduce', 'reduceRight', 'reverse', 'shift', 'slice', 'some', 'sort', 'splice', 'toLocaleString', 'toString', 'unshift', 'values']",
     "String": "['fromCharCode', 'fromCodePoint', 'length', 'name', 'prototype', 'raw']",
     "String.prototype": "['anchor', 'at', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'codePointAt', 'concat', 'constructor', 'endsWith', 'fixed', 'fontcolor', 'fontsize', 'includes', 'indexOf', 'italics', 'lastIndexOf', 'length', 'link', 'localeCompare', 'match', 'matchAll', 'normalize', 'padEnd', 'padStart', 'repeat', 'replace', 'replaceAll', 'search', 'slice', 'small', 'split', 'startsWith', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toString', 'toUpperCase', 'trim', 'trimEnd', 'trimLeft', 'trimRight', 'trimStart', 'valueOf']",
     "Boolean": "['length', 'name', 'prototype']",

Modified: trunk/LayoutTests/js/script-tests/array-unscopables-properties.js (288537 => 288538)


--- trunk/LayoutTests/js/script-tests/array-unscopables-properties.js	2022-01-25 05:13:18 UTC (rev 288537)
+++ trunk/LayoutTests/js/script-tests/array-unscopables-properties.js	2022-01-25 05:38:35 UTC (rev 288538)
@@ -17,6 +17,8 @@
     "findLastIndex",
     "flat",
     "flatMap",
+    "groupBy",
+    "groupByToMap",
     "includes",
     "keys",
     "values"

Modified: trunk/Source/_javascript_Core/ChangeLog (288537 => 288538)


--- trunk/Source/_javascript_Core/ChangeLog	2022-01-25 05:13:18 UTC (rev 288537)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-01-25 05:38:35 UTC (rev 288538)
@@ -1,3 +1,12 @@
+2022-01-24  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Enable Array#groupBy and Array#groupByToMap
+        https://bugs.webkit.org/show_bug.cgi?id=235549
+
+        Reviewed by Ross Kirsling.
+
+        * runtime/OptionsList.h:
+
 2022-01-24  Cameron McCormack  <[email protected]>
 
         Remove VM::stringCache

Modified: trunk/Source/_javascript_Core/runtime/OptionsList.h (288537 => 288538)


--- trunk/Source/_javascript_Core/runtime/OptionsList.h	2022-01-25 05:13:18 UTC (rev 288537)
+++ trunk/Source/_javascript_Core/runtime/OptionsList.h	2022-01-25 05:38:35 UTC (rev 288538)
@@ -538,7 +538,7 @@
     /* Feature Flags */\
     \
     v(Bool, useArrayFindLastMethod, true, Normal, "Expose the findLast() and findLastIndex() methods on Array and %TypedArray%.") \
-    v(Bool, useArrayGroupByMethod, false, Normal, "Expose the groupBy() and groupByToMap() methods on Array.") \
+    v(Bool, useArrayGroupByMethod, true, Normal, "Expose the groupBy() and groupByToMap() methods on Array.") \
     v(Bool, useAtMethod, true, Normal, "Expose the at() method on Array, %TypedArray%, and String.") \
     v(Bool, useHasOwn, true, Normal, "Expose the Object.hasOwn method") \
     v(Bool, useImportAssertion, false, Normal, "Enable import assertion.") \
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to