RESOLVED FIXED 236541
`Array#{ groupBy, groupByToMap }` should throw a `TypeError` when `this` is `null` or `undefined`
https://bugs.webkit.org/show_bug.cgi?id=236541
Summary `Array#{ groupBy, groupByToMap }` should throw a `TypeError` when `this` is `...
zloirock
Reported 2022-02-12 10:07:56 PST
(tested in playwright) Array.prototype.groupBy.call(null, () => { /* empty */ }) // should be a TypeError Array.prototype.groupByToMap.call(null, () => { /* empty */ }) // should be a TypeError
Attachments
Patch (3.92 KB, patch)
2022-02-14 09:42 PST, Yusuke Suzuki
no flags
Alexey Shvayka
Comment 1 2022-02-14 09:31:55 PST
(In reply to zloirock from comment #0) > (tested in playwright) > > Array.prototype.groupBy.call(null, () => { /* empty */ }) // should be a > TypeError > Array.prototype.groupByToMap.call(null, () => { /* empty */ }) // should be > a TypeError Wow, that's a nice catch, thank you. We've missed "use strict".
Yusuke Suzuki
Comment 2 2022-02-14 09:42:33 PST
Alexey Shvayka
Comment 3 2022-02-14 09:45:08 PST
Comment on attachment 451916 [details] Patch I wish we could mandate "use strict" for built-ins with exception of Reflect.has, which we need to be sloppy mode JS built-in for inlining + caching.
EWS
Comment 4 2022-02-14 16:15:42 PST
Committed r289780 (247248@main): <https://commits.webkit.org/247248@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 451916 [details].
Radar WebKit Bug Importer
Comment 5 2022-02-14 16:16:18 PST
Note You need to log in before you can comment on or make changes to this bug.