Skip to content

Commit

Permalink
chore: Avoid using deprecated Buffer constructor (#1510)
Browse files Browse the repository at this point in the history
safe-buffer is already used and provides Buffer.alloc polyfill, so
just use Buffer.alloc directly to avoid hitting deprecated API.

Refs:
https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor
  • Loading branch information
ChALkeR authored and reconbot committed Mar 2, 2018
1 parent 45b3a2f commit 0c1533b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bindings/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class MockBinding extends BaseBinding {
this.isOpen = false;
this.port = null;
this.lastWrite = null;
this.recording = new Buffer(0);
this.recording = Buffer.alloc(0);
this.writeOperation = null; // in flight promise or null
}

Expand Down

0 comments on commit 0c1533b

Please sign in to comment.