-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.
Description
Current behavior of Buffer.from when a function is passed as the first argument:
$ nvm use 12
Now using node v12.0.0-nightly201902158e68dc53b3 (npm v6.7.0)
$ node
> Buffer.from(() => {})
<Buffer >
> Buffer.from((x,y,z) => {})
<Buffer 00 00 00>That doesn't seem useful, so passing a function in is most likely a programmers error, so we could throw errors on that to indicate those early. Thoughts?
If there are no immediate objections, I'll make a draft PR.
Trott, BridgeAR, ZYSzys, devsnek and antsmartian
Metadata
Metadata
Assignees
Labels
bufferIssues and PRs related to the buffer subsystem.Issues and PRs related to the buffer subsystem.