Bug 216817
Summary: | A question about TypedArray.prototype.lastIndexOf | ||
---|---|---|---|
Product: | WebKit | Reporter: | NWU_NISL <nisl_grammarly1> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ashvayka, fpizlo, keith_miller, webkit-bug-importer, ysuzuki |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Local Build | ||
Hardware: | PC | ||
OS: | Linux |
NWU_NISL
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
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/69396412>
Keith Miller
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.
Keith Miller
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 ***