From b10668ce74316c8965a5b19a8b4365c90f75e17f Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 16 May 2017 17:32:34 +1000 Subject: src/liolib.js: Add stubs for flush --- src/liolib.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') 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 }; -- cgit v1.2.3-70-g09d2