summaryrefslogtreecommitdiff
path: root/src/ldo.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-08 12:32:08 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-08 15:31:29 +1000
commit2977fe002407b6f86efa4ba5216f567082f33e45 (patch)
treeda7e0127cd26534d01655e7b6a5c8732fb4920a0 /src/ldo.js
parent8c8585a0bba0e05b6382f2f4f063515b5988639c (diff)
downloadfengari-2977fe002407b6f86efa4ba5216f567082f33e45.tar.gz
fengari-2977fe002407b6f86efa4ba5216f567082f33e45.tar.bz2
fengari-2977fe002407b6f86efa4ba5216f567082f33e45.zip
Move string functions to centralised lstring.js
Diffstat (limited to 'src/ldo.js')
-rw-r--r--src/ldo.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ldo.js b/src/ldo.js
index 5865f96..39ba4dc 100644
--- a/src/ldo.js
+++ b/src/ldo.js
@@ -13,6 +13,7 @@ const llimit = require('./llimit.js');
const lobject = require('./lobject.js');
const lparser = require('./lparser.js');
const lstate = require('./lstate.js');
+const lstring = require('./lstring.js');
const ltm = require('./ltm.js');
const lvm = require('./lvm.js');
const CT = defs.constant_types;
@@ -23,11 +24,11 @@ const TValue = lobject.TValue;
const seterrorobj = function(L, errcode, oldtop) {
switch (errcode) {
case TS.LUA_ERRMEM: {
- L.stack[oldtop] = L.l_G.intern(defs.to_luastring("not enough memory", true));
+ L.stack[oldtop] = new TValue(CT.LUA_TLNGSTR, lstring.luaS_newliteral(L, "not enough memory"));
break;
}
case TS.LUA_ERRERR: {
- L.stack[oldtop] = L.l_G.intern(defs.to_luastring("error in error handling", true));
+ L.stack[oldtop] = new TValue(CT.LUA_TLNGSTR, lstring.luaS_newliteral(L, "error in error handling"));
break;
}
default: {
@@ -401,7 +402,7 @@ const recover = function(L, status) {
*/
const resume_error = function(L, msg, narg) {
L.top -= narg; /* remove args from the stack */
- L.stack[L.top++] = L.l_G.intern(defs.to_luastring(msg)); /* push error message */
+ L.stack[L.top++] = new TValue(CT.LUA_TLNGSTR, lstring.luaS_newliteral(L, msg)); /* push error message */
assert(L.top <= L.ci.top, "stack overflow");
return TS.LUA_ERRRUN;
};