Bug 173157
Summary: | [DFG] Add ArrayIncludes intrinsic | ||
---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> |
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> |
Status: | NEW | ||
Severity: | Normal | CC: | saam |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Bug Depends on: | 172421 | ||
Bug Blocks: |
Yusuke Suzuki
We can implement ArrayIncludes intrinsic by using ArrayIndexOf intrinsic.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Yusuke Suzuki
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.