[Webkit-unassigned] [Bug 220507] New: An issue about %TypedArray%.prototype.sort

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 11 05:12:53 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=220507

            Bug ID: 220507
           Summary: An issue about %TypedArray%.prototype.sort
           Product: WebKit
           Version: WebKit Local Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: nisl_grammarly1 at 163.com

#version: 
dbae081(https://github.com/WebKit/WebKit-http/commit/dbae081ad7e22d9ab61edf2f337f6c2bb593c7f8)

#Testcase:
a = 10;
b = new Uint8Array(a);
b.sort(1);

#Command:
./webkit/WebKitBuild/Release/bin/jsc testcase.js

#Output:
No exceptions are thrown

#Expected output:
TypeError: 1 is not a function

#Description:

According to ES2019 standard, the steps of '%TypedArray%.prototype.sort' are as follows.
>22.2.3.26%TypedArray%.prototype.sort ( comparefn )
> 1. If comparefn is not undefined and IsCallable(comparefn) is false, throw a TypeError exception.
> ...

When executing the above test case, the parameter of %TypedArray%.prototype.sort is 1. According to the standard, a TypeError should be thrown, but JavaScriptCore did not throw any error.
The ECMAScript standard reference is as follow:
http://www.ecma-international.org/ecma-262/10.0/index.html#sec-%typedarray%.prototype.sort

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210111/cb77a2a8/attachment.htm>


More information about the webkit-unassigned mailing list