Skip to content

Commit a6e889c

Browse files
authored
Merge pull request #244 from DanTup/fix-buffer-deprecation-warning
Change new Buffer(0) to Buffer.alloc(0) to prevent deprecation warning
2 parents 049665a + 855c9e5 commit a6e889c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

adapter/src/protocol.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export class ProtocolServer extends ee.EventEmitter implements VSCodeDebugAdapte
123123
public start(inStream: NodeJS.ReadableStream, outStream: NodeJS.WritableStream): void {
124124
this._sequence = 1;
125125
this._writableStream = outStream;
126-
this._rawData = new Buffer(0);
126+
this._rawData = Buffer.alloc(0);
127127

128128
inStream.on('data', (data: Buffer) => this._handleData(data));
129129

testSupport/src/protocolClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class ProtocolClient extends ee.EventEmitter {
1414
private outputStream: stream.Writable;
1515
private sequence: number;
1616
private pendingRequests = new Map<number, (e: DebugProtocol.Response) => void>();
17-
private rawData = new Buffer(0);
17+
private rawData = Buffer.alloc(0);
1818
private contentLength: number;
1919

2020
constructor() {

0 commit comments

Comments
 (0)