From cbcd6f9001d5b18957b7f5a3fb88865c863d9464 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Tue, 1 Aug 2017 12:35:34 +0200 Subject: Use array of bytes instead of DataView (until we fetch binary) --- src/lauxlib.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lauxlib.js b/src/lauxlib.js index 1314d34..d13b2bb 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -788,9 +788,9 @@ if (!WEB) { const getF = function(L, ud) { let lf = ud; - let dv = lf.f instanceof Uint8Array ? new DataView(new ArrayBuffer(lf.f)) : null; + let f = lf.f; lf.f = null; - return dv; + return f; }; getc = function(lf) { @@ -813,7 +813,7 @@ if (!WEB) { if (xhr.status >= 200 && xhr.status <= 299) { /* TODO: Synchronous xhr alway return a js string */ - lf.f = new Uint8Array(lua.to_luastring(xhr.response)); + lf.f = lua.to_luastring(xhr.response); } else { lf.err = xhr.status; return errfile(L, "open", fnameindex, xhr.status); -- cgit v1.2.3-70-g09d2