summaryrefslogtreecommitdiff
path: root/src/lauxlib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-08-01 12:10:02 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-08-10 08:48:24 +0200
commit67d8a94eb7dd1f9f09a501cc6b39ac2cd11584da (patch)
tree6bcb76221e9c1fe9b48e08b4314280e3eb3f0fb5 /src/lauxlib.js
parentc2c95f23d0a9adeb6a7c473461e74cfbbf8307eb (diff)
downloadfengari-67d8a94eb7dd1f9f09a501cc6b39ac2cd11584da.tar.gz
fengari-67d8a94eb7dd1f9f09a501cc6b39ac2cd11584da.tar.bz2
fengari-67d8a94eb7dd1f9f09a501cc6b39ac2cd11584da.zip
Synchronous xhr can't edit responseType
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r--src/lauxlib.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 0db125e..1314d34 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -808,11 +808,12 @@ if (!WEB) {
let xhr = new XMLHttpRequest();
xhr.open("GET", jsfilename, false);
- xhr.responseType = "arraybuffer";
+ // TODO: find a way to load bytes instead of js string
xhr.send();
if (xhr.status >= 200 && xhr.status <= 299) {
- lf.f = new Uint8Array(xhr.response);
+ /* TODO: Synchronous xhr alway return a js string */
+ lf.f = new Uint8Array(lua.to_luastring(xhr.response));
} else {
lf.err = xhr.status;
return errfile(L, "open", fnameindex, xhr.status);