Hi everyone, According to ES specification (https://tc39.github.io/ecma262/#sec-array.prototype.sort) Array.sort param should be a comparefn or undefined value, otherwise should throw a TypeError. steps to reproduce: var obj = {}; var arr = []; arr.sort(obj); arr.sort(obj, obj); Actual results: pass without failures Expected results: TypeError: The comparison function must be either a function or undefined V8, Chakra and Spidermonkey works as expected.
OS: Ubuntu 16.04 x64 jsc version: 234654 cinfuzz
Created attachment 346811 [details] Patch
Comment on attachment 346811 [details] Patch Clearing flags on attachment: 346811 Committed r234716: <https://trac.webkit.org/changeset/234716>
All reviewed patches have been landed. Closing bug.
<rdar://problem/43077213>
Comment on attachment 346811 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=346811&action=review > Source/JavaScriptCore/builtins/ArrayPrototype.js:602 > + @throwTypeError("Array.prototype.sort requires the comparsion function be a function or undefined"); Might also want to fix the typo here: both before and after this patch it says "comparsion" rather than "comparison".