mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-09-11 08:55:23 +03:00
Update Runtime-node.js
This commit is contained in:
parent
b07cac6e7e
commit
4418684cfb
@ -16,7 +16,7 @@ $JSRTS.prim_writeStr = function (x) { return process.stdout.write(x) };
|
||||
|
||||
$JSRTS.prim_readStr = function () {
|
||||
var ret = '';
|
||||
var b = new Buffer(1024);
|
||||
var b = Buffer.alloc(1024);
|
||||
var i = 0;
|
||||
while (true) {
|
||||
$JSRTS.fs.readSync(0, b, i, 1)
|
||||
@ -26,7 +26,7 @@ $JSRTS.prim_readStr = function () {
|
||||
}
|
||||
i++;
|
||||
if (i == b.length) {
|
||||
var nb = new Buffer(b.length * 2);
|
||||
var nb = Buffer.alloc(b.length * 2);
|
||||
b.copy(nb)
|
||||
b = nb;
|
||||
}
|
||||
@ -37,4 +37,4 @@ $JSRTS.prim_readStr = function () {
|
||||
$JSRTS.die = function (message) {
|
||||
console.error(message);
|
||||
process.exit(-1);
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user