Skip to content
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

Pending deprecation for new Buffer() #15

Closed
sholladay opened this issue Jul 29, 2017 · 3 comments
Assignees
Labels
lts
Milestone

Comments

@sholladay
Copy link

@sholladay sholladay commented Jul 29, 2017

On Node 8...

// my-app.js
require('b64');
$ node --throw-deprecation --pending-deprecation my-app
internal/process/warning.js:151
        throw warning;
        ^

DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead.
    at showFlaggedDeprecation (buffer.js:100:13)
    at new Buffer (buffer.js:121:3)
    at Object.<anonymous> (/Users/sholladay/sandbox/b64-test/node_modules/b64/lib/decoder.js:17:12)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)

Obviously this does not have an immediate impact for most people given that these flags are uncommon outside of development. But just a heads up that decoder.js#L17 needs an update to use one of the more explicit Buffer construction methods.

@AdriVanHoudt

This comment has been minimized.

Copy link

@AdriVanHoudt AdriVanHoudt commented Jul 31, 2017

are the new constructors supported in node 4?

@kanongil

This comment has been minimized.

Copy link
Member

@kanongil kanongil commented Jul 31, 2017

It seems that the fix should be simple in this case – just remove the line, as internals.blank is not even used.

@AdriVanHoudt

This comment has been minimized.

Copy link

@AdriVanHoudt AdriVanHoudt commented Jul 31, 2017

@kanongil nice catch

@geek geek self-assigned this Jul 31, 2017
@geek geek added the bug label Jul 31, 2017
@geek geek added this to the 3.0.3 milestone Jul 31, 2017
@geek geek added lts and removed bug labels Jul 31, 2017
@geek geek closed this in #16 Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.