summaryrefslogtreecommitdiff
path: root/src/lua.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua.js')
-rw-r--r--src/lua.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lua.js b/src/lua.js
index 85d4b64..d4f620b 100644
--- a/src/lua.js
+++ b/src/lua.js
@@ -4,6 +4,12 @@
const assert = require('assert');
const luaconf = require('./luaconf.js');
+// To avoid charCodeAt everywhere
+const char = [];
+for (let i = 0; i < 127; i++)
+ char[String.fromCharCode(i)] = i;
+module.exports.char = char;
+
/* mark for precompiled code ('<esc>Lua') */
const LUA_SIGNATURE = "\x1bLua";