Skip to content

Commit 8a04893

Browse files
Akos KittaChristian Weichel
Akos Kitta
authored and
Christian Weichel
committed
Got rid of the deprecated new Buffer.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent e31239d commit 8a04893

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arduino-ide-extension/src/node/core-service-impl.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export class CoreServiceImpl implements CoreService {
5454
try {
5555
await new Promise<void>((resolve, reject) => {
5656
result.on('data', (cr: CompileResp) => {
57-
this.toolOutputService.publishNewOutput("compile", new Buffer(cr.getOutStream_asU8()).toString());
58-
this.toolOutputService.publishNewOutput("compile error", new Buffer(cr.getErrStream_asU8()).toString());
57+
this.toolOutputService.publishNewOutput("compile", Buffer.from(cr.getOutStream_asU8()).toString());
58+
this.toolOutputService.publishNewOutput("compile error", Buffer.from(cr.getErrStream_asU8()).toString());
5959
});
6060
result.on('error', error => reject(error));
6161
result.on('end', () => resolve());
@@ -104,15 +104,15 @@ export class CoreServiceImpl implements CoreService {
104104
try {
105105
await new Promise<void>((resolve, reject) => {
106106
result.on('data', (cr: UploadResp) => {
107-
this.toolOutputService.publishNewOutput("upload", new Buffer(cr.getOutStream_asU8()).toString());
108-
this.toolOutputService.publishNewOutput("upload error", new Buffer(cr.getErrStream_asU8()).toString());
107+
this.toolOutputService.publishNewOutput("upload", Buffer.from(cr.getOutStream_asU8()).toString());
108+
this.toolOutputService.publishNewOutput("upload error", Buffer.from(cr.getErrStream_asU8()).toString());
109109
});
110110
result.on('error', error => reject(error));
111111
result.on('end', () => resolve());
112112
});
113113
this.toolOutputService.publishNewOutput("upload", "Upload complete\n");
114114
} catch (e) {
115-
this.toolOutputService.publishNewOutput("upload error", `Uplaod error: ${e}\n`);
115+
this.toolOutputService.publishNewOutput("upload error", `Upload error: ${e}\n`);
116116
throw e;
117117
}
118118
}

0 commit comments

Comments
 (0)