From bd0bacb637fb11556e76cbd929ed833dcd3abe97 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 28 Apr 2019 22:14:28 +1000 Subject: [PATCH] javascript/library: Use Buffer.alloc() since new Buffer() is deprecated. --- ports/javascript/library.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/javascript/library.js b/ports/javascript/library.js index ed58167d5d..85fa3e2edd 100644 --- a/ports/javascript/library.js +++ b/ports/javascript/library.js @@ -48,7 +48,7 @@ mergeInto(LibraryManager.library, { var mp_interrupt_char = Module.ccall('mp_hal_get_interrupt_char', 'number', ['number'], ['null']); var fs = require('fs'); - var buf = new Buffer(1); + var buf = Buffer.alloc(1); try { var n = fs.readSync(process.stdin.fd, buf, 0, 1); if (n > 0) {