[Webkit-unassigned] [Bug 159385] ECMAScript 2016: %TypedArray%.prototype.includes implementation
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Jul 9 14:59:16 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=159385
--- Comment #39 from Caio Lima <ticaiolima at gmail.com> ---
Comment on attachment 283116
--> https://bugs.webkit.org/attachment.cgi?id=283116
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=283116&action=review
Good points in comment. Thank you for the contributions, mainly because I didn't pay attention to float -> double case!
>> Source/JavaScriptCore/runtime/ToNativeFromValue.h:58
>> + return Adaptor::toNativeFromDouble(value.toNumber(exec), result);
>
> I think this is a bug too.
>
> You are calling toNumber() on the value.
> If valueToFind is an Object, that will call valueOf() on it. If it's null or undefined, it will be converted to number too.
>
> You just need to return false here.
>
> You need a test covering this case.
Actually, we have test covering this case. Check LayoutTests/js/script-tests/typed-array-includes.js:17-23.
When this function is called from "genericTypedArrayViewProtoFuncIncludes", we are sure that value.isNumber() is true. However, maintaining this last case I think it keeps the function more reusable.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160709/36089c3d/attachment.html>
More information about the webkit-unassigned
mailing list