From 2e5b595a2e04fe72555a565af4aae43560946473 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Wed, 29 Mar 2017 11:57:43 +0200 Subject: Never use js strings internally --- src/ldo.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ldo.js') diff --git a/src/ldo.js b/src/ldo.js index 50d455e..54d1ac0 100644 --- a/src/ldo.js +++ b/src/ldo.js @@ -448,9 +448,9 @@ const lua_yieldk = function(L, nresults, ctx, k) { if (L.nny > 0) { if (L !== L.l_G.mainthread) - ldebug.luaG_runerror(L, "attempt to yield across a JS-call boundary"); + ldebug.luaG_runerror(L, lua.to_luastring("attempt to yield across a JS-call boundary")); else - ldebug.luaG_runerror(L, "attempt to yield from outside a coroutine"); + ldebug.luaG_runerror(L, lua.to_luastring("attempt to yield from outside a coroutine")); } L.status = TS.LUA_YIELD; @@ -519,8 +519,8 @@ class SParser { } const checkmode = function(L, mode, x) { - if (mode && mode.indexOf(x.charAt(0)) === -1) { - lapi.lua_pushstring(L, `attempt to load a ${x} chunk (mode is '${mode}')`); + if (mode && mode.indexOf(x.charCodeAt(0)) === -1) { + lapi.lua_pushstring(L, lua.to_luastring(`attempt to load a ${lobject.jsstring(x)} chunk (mode is '${mode}')`)); luaD_throw(L, TS.LUA_ERRSYNTAX); } }; -- cgit v1.2.3-54-g00ecf