summaryrefslogtreecommitdiff
path: root/src/lauxlib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-11-12 19:00:12 +1100
committerdaurnimator <quae@daurnimator.com>2017-11-12 20:33:21 +1100
commitbb79aab60a40e485d144bfac10d70fbe213eb30c (patch)
tree6be99b4961f1f07ba0d07a571c76b2412ccdcf31 /src/lauxlib.js
parent1ba4c1ca128b49eea3dca8cc053fce817e1c0fef (diff)
downloadfengari-bb79aab60a40e485d144bfac10d70fbe213eb30c.tar.gz
fengari-bb79aab60a40e485d144bfac10d70fbe213eb30c.tar.bz2
fengari-bb79aab60a40e485d144bfac10d70fbe213eb30c.zip
src/lauxlib.js: Add encodeURI call into luaL_loadfilex to match loadlib.js
In future this should create a uri from lua string rather than potentially throwing errors in to_jsstring
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 24d2203..8d110ea 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -740,9 +740,10 @@ if (WEB) {
} else {
lua.lua_pushfstring(L, lua.to_luastring("@%s"), filename);
- let jsfilename = lua.to_jsstring(filename);
+ let path = lua.to_jsstring(filename);
+ path = encodeURI(path);
let xhr = new XMLHttpRequest();
- xhr.open("GET", jsfilename, false);
+ xhr.open("GET", path, false);
// TODO: find a way to load bytes instead of js string
xhr.send();