Summary: | Handle non-function, non-undefined comparator in Array.prototype.sort | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Keith Miller <keith_miller> | ||||||||
Component: | JavaScriptCore | Assignee: | Keith Miller <keith_miller> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | commit-queue, mark.lam, msaboff, saam | ||||||||
Priority: | P2 | ||||||||||
Version: | WebKit Local Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Keith Miller
2016-10-06 14:19:44 PDT
Created attachment 290866 [details]
Patch
Comment on attachment 290866 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290866&action=review > Source/JavaScriptCore/builtins/ArrayPrototype.js:650 > else How about just checking here like `else if (comparator !== @undefined)`? Comment on attachment 290866 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290866&action=review >> Source/JavaScriptCore/builtins/ArrayPrototype.js:650 >> else > > How about just checking here like `else if (comparator !== @undefined)`? We need to avoid doing the check if the length of the array is < 2 since that's observably different behavior from other browsers. Although, we could move that check into the main body instead of the helpers. I'll make that change. Created attachment 290868 [details]
Patch for landing
Created attachment 291380 [details]
Patch for landing
Comment on attachment 291380 [details] Patch for landing Clearing flags on attachment: 291380 Committed r207235: <http://trac.webkit.org/changeset/207235> All reviewed patches have been landed. Closing bug. |