RESOLVED FIXED 271524
Object.groupBy / Map.groupBy doesn’t work for non objects
https://bugs.webkit.org/show_bug.cgi?id=271524
Summary Object.groupBy / Map.groupBy doesn’t work for non objects
Sosuke Suzuki
Reported 2024-03-23 14:09:54 PDT
According to the specification, GroupBy must use RequireObjectCoercible to check that the value is not null or undefined. However, in JSC, @isObject is used to determine this, so calling `Object.groupBy` / `Map.groupBy` with a non-object value will throw a TypeError. poc: ```js Object.groupBy("abc", (ch) => ch === "a" ? "one" : "two"); // Exception: TypeError: Object.groupBy requires that the first argument must be an object ```
Attachments
Sosuke Suzuki
Comment 1 2024-03-23 14:11:11 PDT
If this is a bug, I want to work on this.
Sosuke Suzuki
Comment 2 2024-03-23 23:27:39 PDT
EWS
Comment 3 2024-03-27 07:37:45 PDT
Committed 276736@main (5209f3cb6908): <https://commits.webkit.org/276736@main> Reviewed commits have been landed. Closing PR #26383 and removing active labels.
Radar WebKit Bug Importer
Comment 4 2024-03-27 07:38:12 PDT
Note You need to log in before you can comment on or make changes to this bug.