Use Buffer.(from|alloc) instead of deprecated Buffer API#46
Closed
ChALkeR wants to merge 1 commit intoTritonDataCenter:masterfrom
Closed
Use Buffer.(from|alloc) instead of deprecated Buffer API#46ChALkeR wants to merge 1 commit intoTritonDataCenter:masterfrom
ChALkeR wants to merge 1 commit intoTritonDataCenter:masterfrom
Conversation
This also includes a dependnecy on a polyfill targeting older Node.js versions where Buffer.alloc() and Buffer.from() API is not implemented (Node.js < 4.5.0 and some 5.x versions). Ref: nodejs/node#19079 Ref: https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor Ref: https://nodejs.org/api/buffer.html#buffer_class_buffer Ref: https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md
Contributor
Author
|
|
|
@arekinath would be great if you can merge this and release a new version as this is blocking Yarn from being Node 10 compatible. We can use the fork but that's less than ideal. |
Contributor
Author
|
Bump <3 Would love to get this (and yarnpkg/yarn#5477) fixed! |
joyent-automation
pushed a commit
that referenced
this pull request
Jun 5, 2018
Reviewed by: Alex Wilson <alex.wilson@joyent.com> Reviewed by: Cody Peter Mello <cody.mello@joyent.com>
|
Merged as 175758a, released in 1.14.2 |
Contributor
Author
|
@arekinath Thanks! |
|
@arekinath thanks a lot for the merge and release! It would be ideal if we can propagate this fix all the way to upstream. There are a few more fixes on joyent repos:
Do you think you can help with those too? And since sshpk depends on |
4 tasks
This was referenced Oct 10, 2018
Closed
This was referenced Dec 5, 2018
This was referenced Dec 13, 2018
This was referenced Jun 4, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This also includes a dependnecy on a polyfill targeting older Node.js versions where Buffer.alloc() and Buffer.from() API is not implemented (Node.js < 4.5.0 and some 5.x versions).
This is mostly a line-to-line change, though in some cases, minor code simplification was done, e.g.
was transformed into
Ref: nodejs/node#19079
Ref: https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor
Ref: https://nodejs.org/api/buffer.html#buffer_class_buffer
Ref: https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md
Fixes: #45
Note that this does not completely solve the problem yet, for a complete solution,
asn1(a dependency) should also receive this fix (see below for that one).But fixing the API usage in this package is still required, and a significant portion of tests pass without ever hitting the deprecated Buffer API in
asn1dependency.