We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b07cac6 commit 4418684Copy full SHA for 4418684
jsrts/Runtime-node.js
@@ -16,7 +16,7 @@ $JSRTS.prim_writeStr = function (x) { return process.stdout.write(x) };
16
17
$JSRTS.prim_readStr = function () {
18
var ret = '';
19
- var b = new Buffer(1024);
+ var b = Buffer.alloc(1024);
20
var i = 0;
21
while (true) {
22
$JSRTS.fs.readSync(0, b, i, 1)
@@ -26,7 +26,7 @@ $JSRTS.prim_readStr = function () {
26
}
27
i++;
28
if (i == b.length) {
29
- var nb = new Buffer(b.length * 2);
+ var nb = Buffer.alloc(b.length * 2);
30
b.copy(nb)
31
b = nb;
32
@@ -37,4 +37,4 @@ $JSRTS.prim_readStr = function () {
37
$JSRTS.die = function (message) {
38
console.error(message);
39
process.exit(-1);
40
-};
+};
0 commit comments