You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypedArray#includes and Array#includes are not shipped in V8 yet.
When it happens, buffers will have the method. You can test it with the harmony flag:
Though we might want to override it. v8's implementation (following the spec) is restrictive and slow. e.g. indexOf(), fill(). Instead, to have feature parity with current Buffer API's we should consider our own impl that accepts multi-char strings, etc.
Activity
targos commentedon Oct 27, 2015
TypedArray#includes and Array#includes are not shipped in V8 yet.
When it happens, buffers will have the method. You can test it with the
harmonyflag:trevnorris commentedon Oct 27, 2015
Though we might want to override it. v8's implementation (following the spec) is restrictive and slow. e.g.
indexOf(),fill(). Instead, to have feature parity with current Buffer API's we should consider our own impl that accepts multi-char strings, etc.targos commentedon Oct 28, 2015
@trevnorris good point! Then we can just wrap it around
indexOf.trevnorris commentedon Oct 28, 2015
Oh yeah. Good call. Easy PR for the taking.
sindresorhus commentedon Oct 28, 2015
I made a polyfill: https://github.com/sindresorhus/buffer-includes
rodmachen commentedon Oct 28, 2015
Just added a PR to implement this.
#3568
Fishrock123 commentedon Dec 9, 2015
PR is #3567
buffer: add includes() for parity with TypedArray
buffer: add includes() for parity with TypedArray
buffer: add includes() for parity with TypedArray