Closed iefserge closed 9 years ago
@iefserge The following code:
'use strict';
const runtime = require('runtimejs');
runtime.stdio.defaultStdio.writeLine('hey');
...Produces the following error:
Uncaught exception: /bundle.js:6746: TypeError: memoryBarrier is not a function
TypeError: memoryBarrier is not a function
at VRing.placeBuffers (/bundle.js:6746:3)
at fillReceiveQueue (/bundle.js:6338:22)
at initializeNetworkDevice (/bundle.js:6386:3)
at Object.driver.init (/bundle.js:6204:14)
at PciDevice.setDriver (/bundle.js:4151:10)
at Object.exports.addDriver (/bundle.js:4087:12)
at Object.62.../../core (/bundle.js:6216:13)
at s (/bundle.js:1:254)
at /bundle.js:1:305
at Object.<anonymous> (/bundle.js:6934:1)
# ...
# And lots more `memoryBarrier` errors on different lines
It may be it's a scope error. Maybe put it inside the VRing
function?
@ArielAbreu memoryBarrier
is a native function. Kernel needs to be updated (>= 0.1.11), try
npm install runtime-tools@latest
@iefserge OK! Now printing works, let me test the other things (reading, erroring...).
@iefserge By 'throw on nested readLine', you mean passing another readLine
as the callback for a readline
, right? This is still valid:
runtime.stdio.defaultStdio.readLine(function(text) {
runtime.stdio.defaultStdio.readLine(function(text2) {
// ...
});
});
Right?
nope, that should work.
Code below should throw (trying to read line while reading another line):
runtime.stdio.defaultStdio.readLine(function(text) {});
runtime.stdio.defaultStdio.readLine(function(text2) {});
@iefserge It works perfectly! Though, writeError
should add a newline at the end of the string if given a string: runtime.stdio.defaultStdio.writeError('blah')
-> prints: 'blah(otherstuff)' should print: 'blah\n(otherstuff)'. Guess, I overlooked that in my PR.
:+1: Looks nice! I also notice (don't know if it's just me) that with the new improvements, the shell loads faster and is ready to accept input faster!
@ArielAbreu Thanks!
@iefserge No problem!
Did some stdio lint and cleanup.
Also few improvements:
defaultStdio
onlyR = @ArielAbreu Please confirm that it works for you, not very well tested.