summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-05 09:50:40 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-05 10:00:39 +1000
commit84a0982085967895e9bb5e5439c09960840da2d5 (patch)
tree8bb3571de9540634c7c119f24cdc9a30a5121490
parent42820bafe8433cbba4158ea7a2e11f40e9d2c635 (diff)
downloadfengari-84a0982085967895e9bb5e5439c09960840da2d5.tar.gz
fengari-84a0982085967895e9bb5e5439c09960840da2d5.tar.bz2
fengari-84a0982085967895e9bb5e5439c09960840da2d5.zip
src/lauxlib.js: Fix traceback text
-rw-r--r--src/lauxlib.js2
-rw-r--r--tests/ldblib.js48
2 files changed, 25 insertions, 25 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index d9846c8..389afdf 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -121,7 +121,7 @@ const luaL_traceback = function(L, L1, msg, level) {
level = last - LEVELS2 + 1; /* and skip to last ones */
} else {
lua.lua_getinfo(L1, lua.to_luastring("Slnt", true), ar);
- lua.lua_pushstring(L, ['\n'.charCodeAt(0), '\t'.charCodeAt(0), '.'.charCodeAt(0), '.'.charCodeAt(0), '.'.charCodeAt(0)].concat(ar.short_src));
+ lua.lua_pushstring(L, ['\n'.charCodeAt(0), '\t'.charCodeAt(0)].concat(ar.short_src).concat([':'.charCodeAt(0)]));
if (ar.currentline > 0)
lua.lua_pushliteral(L, `${ar.currentline}:`);
lua.lua_pushliteral(L, " in ");
diff --git a/tests/ldblib.js b/tests/ldblib.js
index 83d0743..4569e98 100644
--- a/tests/ldblib.js
+++ b/tests/ldblib.js
@@ -340,18 +340,18 @@ test('debug.traceback (with a global)', function (t) {
t.strictEqual(
lua.lua_tojsstring(L, -1),
`stack traceback:
-\t...[string "traceback-test"]9: in function 'rec'
-\t...[string "traceback-test"]7: in function 'rec'
-\t...[string "traceback-test"]7: in function 'rec'
-\t...[string "traceback-test"]7: in function 'rec'
-\t...[string "traceback-test"]7: in function 'rec'
-\t...[string "traceback-test"]7: in function 'rec'
-\t...[string "traceback-test"]7: in function 'rec'
-\t...[string "traceback-test"]7: in function 'rec'
-\t...[string "traceback-test"]7: in function 'rec'
-\t...[string "traceback-test"]7: in function 'rec'
-\t...[string "traceback-test"]7: in function 'rec'
-\t...[string "traceback-test"]15: in main chunk`,
+\t[string "traceback-test"]:9: in function 'rec'
+\t[string "traceback-test"]:7: in function 'rec'
+\t[string "traceback-test"]:7: in function 'rec'
+\t[string "traceback-test"]:7: in function 'rec'
+\t[string "traceback-test"]:7: in function 'rec'
+\t[string "traceback-test"]:7: in function 'rec'
+\t[string "traceback-test"]:7: in function 'rec'
+\t[string "traceback-test"]:7: in function 'rec'
+\t[string "traceback-test"]:7: in function 'rec'
+\t[string "traceback-test"]:7: in function 'rec'
+\t[string "traceback-test"]:7: in function 'rec'
+\t[string "traceback-test"]:15: in main chunk`,
"Correct element(s) on the stack"
);
@@ -399,18 +399,18 @@ test('debug.traceback (with a upvalue)', function (t) {
t.strictEqual(
lua.lua_tojsstring(L, -1),
`stack traceback:
-\t...[string "traceback-test"]10: in upvalue 'rec'
-\t...[string "traceback-test"]8: in upvalue 'rec'
-\t...[string "traceback-test"]8: in upvalue 'rec'
-\t...[string "traceback-test"]8: in upvalue 'rec'
-\t...[string "traceback-test"]8: in upvalue 'rec'
-\t...[string "traceback-test"]8: in upvalue 'rec'
-\t...[string "traceback-test"]8: in upvalue 'rec'
-\t...[string "traceback-test"]8: in upvalue 'rec'
-\t...[string "traceback-test"]8: in upvalue 'rec'
-\t...[string "traceback-test"]8: in upvalue 'rec'
-\t...[string "traceback-test"]8: in local 'rec'
-\t...[string "traceback-test"]16: in main chunk`,
+\t[string "traceback-test"]:10: in upvalue 'rec'
+\t[string "traceback-test"]:8: in upvalue 'rec'
+\t[string "traceback-test"]:8: in upvalue 'rec'
+\t[string "traceback-test"]:8: in upvalue 'rec'
+\t[string "traceback-test"]:8: in upvalue 'rec'
+\t[string "traceback-test"]:8: in upvalue 'rec'
+\t[string "traceback-test"]:8: in upvalue 'rec'
+\t[string "traceback-test"]:8: in upvalue 'rec'
+\t[string "traceback-test"]:8: in upvalue 'rec'
+\t[string "traceback-test"]:8: in upvalue 'rec'
+\t[string "traceback-test"]:8: in local 'rec'
+\t[string "traceback-test"]:16: in main chunk`,
"Correct element(s) on the stack"
);