summaryrefslogtreecommitdiff
path: root/src/ldo.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-23 18:02:28 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-27 22:14:38 +1000
commit78f764030414e5c45ea059a5f582885da0282e39 (patch)
treea82fa0e267d91a8e7cb3a5df5444dc276945ddca /src/ldo.js
parent941e38fe2360fc0b4fa6f4ef5c9a9a43c172d528 (diff)
downloadfengari-78f764030414e5c45ea059a5f582885da0282e39.tar.gz
fengari-78f764030414e5c45ea059a5f582885da0282e39.tar.bz2
fengari-78f764030414e5c45ea059a5f582885da0282e39.zip
Introduce setsvalue2s
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 5fa51db..b32e404 100644
--- a/src/ldo.js
+++ b/src/ldo.js
@@ -24,11 +24,11 @@ const TS = defs.thread_status;
const seterrorobj = function(L, errcode, oldtop) {
switch (errcode) {
case TS.LUA_ERRMEM: {
- L.stack[oldtop] = new lobject.TValue(CT.LUA_TLNGSTR, lstring.luaS_newliteral(L, "not enough memory"));
+ lobject.setsvalue2s(L, oldtop, lstring.luaS_newliteral(L, "not enough memory"));
break;
}
case TS.LUA_ERRERR: {
- L.stack[oldtop] = new lobject.TValue(CT.LUA_TLNGSTR, lstring.luaS_newliteral(L, "error in error handling"));
+ lobject.setsvalue2s(L, oldtop, lstring.luaS_newliteral(L, "error in error handling"));
break;
}
default: {
@@ -465,7 +465,8 @@ const recover = function(L, status) {
*/
const resume_error = function(L, msg, narg) {
L.top -= narg; /* remove args from the stack */
- L.stack[L.top++] = new lobject.TValue(CT.LUA_TLNGSTR, lstring.luaS_newliteral(L, msg)); /* push error message */
+ lobject.setsvalue2s(L, L.top, lstring.luaS_newliteral(L, msg)); /* push error message */
+ L.top++;
assert(L.top <= L.ci.top, "stack overflow");
return TS.LUA_ERRRUN;
};