-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect documentation or bug in Node #9165
Comments
So, one thing: The docs for v4.x should say it was introduced in
That is because
Yeah, that should be easy to fix.
If you want/need to support versions below < 4.5 and < 5.10.0, you’ll likely have to stick with |
Sounds good! Out of curiosity, |
`Buffer.from` was present in `v3.0.0` but didn’t work for any combination of arguments as it was inherited from `Uint8Array`. This corrects the data to contain the version in which Node’s own `Buffer.from` was added, namely `v4.5.0`. Fixes: nodejs#9165
Not for Node < 4.5.0, due to the way in which V8 implements |
Yeah. All of these fail (but different node versions complain differently)
So 2 things remain:
|
Are you referring to the fact that v5.10.0 seems higher than v4.5.0, so it should incorporate features that are in all v4.x versions? Chronologically, v4.5.0 was released 5 months later than v5.10.0, and v4.x is still actively maintained. Occasionally, important new features like
Fwiw, there are a few polyfills available on npm. Also, you can just use |
I was referring to v5.0 (in my OP) but I guess this answers that as well.
For my current use case, I need
|
No, as long as you know that the input type will always be the same, everything’s fine with using the old API – It’s when you accept input that could be controlled by somebody else (like from the browser) where things get potentially unsafe. |
`Buffer.from` was present in `v3.0.0` but didn’t work for any combination of arguments as it was inherited from `Uint8Array`. This corrects the data to contain the version in which Node’s own `Buffer.from` was added, namely `v4.5.0`. Fixes: #9165 PR-URL: #9167 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
`Buffer.from` was present in `v3.0.0` but didn’t work for any combination of arguments as it was inherited from `Uint8Array`. This corrects the data to contain the version in which Node’s own `Buffer.from` was added, namely `v4.5.0`. Fixes: #9165 PR-URL: #9167 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Fixed in #9167 |
Per this documentation: https://nodejs.org/dist/latest-v4.x/docs/api/buffer.html#buffer_class_method_buffer_from_array
Buffer.from(array)
was added in v3.0. However, this example (taken from docs) fails in Node v4.2.3 and Node v4.4.4Now as per latest docs: https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_array, our friend seems to have been "added in v5.10.0"
And rightfully so, fails in v5.0.0
So, my question is:
All the tests were done using nvm on a 64 bit OSX El Capitan.
The text was updated successfully, but these errors were encountered: