Skip to content

Commit

Permalink
chore: Avoid using deprecated Buffer constructor (serialport#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 Thomas committed Apr 9, 2018
1 parent e93af71 commit 0f4aa39
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 0f4aa39

Please sign in to comment.