summaryrefslogtreecommitdiff
path: root/src/llex.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-11-12 15:54:59 +1100
committerdaurnimator <quae@daurnimator.com>2017-11-12 15:54:59 +1100
commit542c431989bff3fc3a6687f182a8c61a7861efd9 (patch)
tree0a016960930dc7227de2ff746e0687cb0d9dfc54 /src/llex.js
parentcf0d23270e3af24c1cbaebc9c8a1d51eb80b1840 (diff)
downloadfengari-542c431989bff3fc3a6687f182a8c61a7861efd9.tar.gz
fengari-542c431989bff3fc3a6687f182a8c61a7861efd9.tar.bz2
fengari-542c431989bff3fc3a6687f182a8c61a7861efd9.zip
src/llex.js: Export LUA_ENV
Diffstat (limited to 'src/llex.js')
-rw-r--r--src/llex.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/llex.js b/src/llex.js
index a20f308..cc3d0ef 100644
--- a/src/llex.js
+++ b/src/llex.js
@@ -16,6 +16,8 @@ const char = defs.char;
const FIRST_RESERVED = 257;
+const LUA_ENV = defs.to_luastring("_ENV", true);
+
const RESERVED = {
/* terminal symbols denoted by reserved words */
TK_AND: FIRST_RESERVED,
@@ -189,7 +191,7 @@ const luaX_setinput = function(L, ls, z, source, firstchar) {
ls.linenumber = 1;
ls.lastline = 1;
ls.source = source;
- ls.envn = lstring.luaS_newliteral(L, "_ENV");
+ ls.envn = lstring.luaS_bless(L, LUA_ENV);
};
const check_next1 = function(ls, c) {
@@ -596,6 +598,7 @@ const luaX_lookahead = function(ls) {
};
module.exports.FIRST_RESERVED = FIRST_RESERVED;
+module.exports.LUA_ENV = LUA_ENV;
module.exports.LexState = LexState;
module.exports.RESERVED = RESERVED;
module.exports.isreserved = isreserved;