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

Add Buffer property to buffer module #6179

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ declare module "buffer" {
declare var kMaxLength: number;
declare var INSPECT_MAX_BYTES: number;
declare function transcode(source: Buffer, fromEnc: buffer$Encoding, toEnc: buffer$Encoding): Buffer;
declare var Buffer: typeof global.Buffer;
}

type child_process$execOpts = {
Expand Down
4 changes: 4 additions & 0 deletions tests/node_tests/buffer/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ buffer = Buffer.from("foo", "utf8");
// flow didn't used to support a subclass hiding a superclass member, so this
// used to check out as ok, even though it is not correct.
buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72], (a:number) => a + 1, {}); // error

// Explicitly importing Buffer is rarely needed, but correct.
let ImportedBuffer = require("buffer").Buffer;
buffer = new ImportedBuffer(0);
Loading