| Summary: | `Array#{ groupBy, groupByToMap }` should throw a `TypeError` when `this` is `null` or `undefined` | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | zloirock <zloirock> | ||||
| Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | ashvayka, ews-watchlist, joepeck, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=235549 | ||||||
| Attachments: |
|
||||||
(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". Created attachment 451916 [details]
Patch
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.
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]. |
(tested in playwright) Array.prototype.groupBy.call(null, () => { /* empty */ }) // should be a TypeError Array.prototype.groupByToMap.call(null, () => { /* empty */ }) // should be a TypeError