Bug 216817 - A question about TypedArray.prototype.lastIndexOf
Summary: A question about TypedArray.prototype.lastIndexOf
Status: RESOLVED DUPLICATE of bug 213715
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-22 01:32 PDT by NWU_NISL
Modified: 2020-09-22 16:08 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NWU_NISL 2020-09-22 01:32:40 PDT
According to ES10.0, "%TypedArray%.prototype.lastIndexOf" is a distinct function that implements the same algorithm as "Array.prototype.lastIndexOf". And it's optimization must not introduce any observable changes in the specified behaviour of the algorithm. But these two methods acts differently when no argument is passed. Is this an issue about javascriptCore?

#### version
dbae081


#### command
webkit/WebKitBuild/Debug/bin/jsc testcase.js


#### testcase
var v1 = [];
print(v1.lastIndexOf());

var v2 = new Uint8Array();
print(v2.lastIndexOf());


#### output
-1
TypeError: Expected at least one argument



#### expected output
-1
-1


contributor:Yuan Wang
Comment 1 Radar WebKit Bug Importer 2020-09-22 15:42:26 PDT
<rdar://problem/69396412>
Comment 2 Keith Miller 2020-09-22 16:02:55 PDT
Hi there, thanks for reporting this issue. You're correct! That does indeed look like a bug.

Seems like it should be simple to fix.
Comment 3 Keith Miller 2020-09-22 16:08:23 PDT
Actually, looks like this was fixed a while ago in https://bugs.webkit.org/show_bug.cgi?id=213715

Regardless, thanks again for the report!

*** This bug has been marked as a duplicate of bug 213715 ***