<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>220507</bug_id>
          
          <creation_ts>2021-01-11 05:12:53 -0800</creation_ts>
          <short_desc>An issue about %TypedArray%.prototype.sort</short_desc>
          <delta_ts>2021-01-20 14:50:15 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Local Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>216952</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="NWU_NISL">nisl_grammarly1</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mark.lam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1718664</commentid>
    <comment_count>0</comment_count>
    <who name="NWU_NISL">nisl_grammarly1</who>
    <bug_when>2021-01-11 05:12:53 -0800</bug_when>
    <thetext>#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 &apos;%TypedArray%.prototype.sort&apos; are as follows.
&gt;22.2.3.26%TypedArray%.prototype.sort ( comparefn )
&gt; 1. If comparefn is not undefined and IsCallable(comparefn) is false, throw a TypeError exception.
&gt; ...

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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1720334</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-01-18 05:13:12 -0800</bug_when>
    <thetext>&lt;rdar://problem/73320341&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1721011</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2021-01-20 14:50:15 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 216952 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>