Bug 173157 - [DFG] Add ArrayIncludes intrinsic
Summary: [DFG] Add ArrayIncludes intrinsic
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on: 172421
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-09 06:12 PDT by Yusuke Suzuki
Modified: 2017-06-13 10:00 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2017-06-09 06:12:33 PDT
We can implement ArrayIncludes intrinsic by using ArrayIndexOf intrinsic.
Comment 1 Yusuke Suzuki 2017-06-13 10:00:49 PDT
No, we can share large part of ArrayIndexOf code. However, ArrayIncludes slightly different from ArrayIndexOf.

https://tc39.github.io/ecma262/#sec-array.prototype.includes

NOTE:
The includes method intentionally differs from the similar indexOf method in two ways. First, it uses the SameValueZero algorithm, instead of Strict Equality Comparison, allowing it to detect NaN array elements. Second, it does not skip missing array elements, instead treating them as undefined.