diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-16 17:32:34 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-16 17:37:31 +1000 |
commit | b10668ce74316c8965a5b19a8b4365c90f75e17f (patch) | |
tree | eeea1881e822678485fcd708cfdf4c610124a118 /src/liolib.js | |
parent | a553ac00a4119eb247df5e123df60d447e96c31a (diff) | |
download | fengari-b10668ce74316c8965a5b19a8b4365c90f75e17f.tar.gz fengari-b10668ce74316c8965a5b19a8b4365c90f75e17f.tar.bz2 fengari-b10668ce74316c8965a5b19a8b4365c90f75e17f.zip |
src/liolib.js: Add stubs for flush
Diffstat (limited to 'src/liolib.js')
-rw-r--r-- | src/liolib.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/liolib.js b/src/liolib.js index 575b3ec..6c7d945 100644 --- a/src/liolib.js +++ b/src/liolib.js @@ -105,14 +105,28 @@ const f_write = function(L) { return g_write(L, f, 2); }; +const io_flush = function (L) { + /* stub, as node doesn't have synchronized buffered IO */ + getiofile(L, IO_OUTPUT); + return lauxlib.luaL_fileresult(L, true, null, null); +}; + +const f_flush = function (L) { + /* stub, as node doesn't have synchronized buffered IO */ + tofile(L); + return lauxlib.luaL_fileresult(L, true, null, null); +}; + const iolib = { "close": io_close, + "flush": io_flush, "type": io_type, "write": io_write }; const flib = { "close": io_close, + "flush": f_flush, "write": f_write, "__tostring": f_tostring }; |