X Tutup
Skip to content

Commit fdbd0b2

Browse files
ChouUnclaude
andcommitted
style: extract setLuaHeader string to variable for prettier
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d61f863 commit fdbd0b2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/unit/error.spec.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,19 +362,21 @@ test("sourceMapTraceback maps anonymous function locations in .lua files (#1665)
362362
"\t[C]: in ?",
363363
].join("\n");
364364

365+
// Inject sourcemap for "main.lua" and mock debug.traceback to return file-based frames.
366+
const header = `
367+
__TS__sourcemap = { ["main.lua"] = ${mapping} };
368+
local __real_tb = debug.traceback
369+
debug.traceback = function() return ${JSON.stringify(fakeTraceback)} end
370+
`;
371+
365372
const builder = util.testFunction`
366373
return (() => {
367374
return (() => {
368375
return (debug.traceback as (this: void) => string)();
369376
})();
370377
})();
371378
`
372-
// Inject sourcemap for "main.lua" and mock debug.traceback to return file-based frames.
373-
.setLuaHeader(`
374-
__TS__sourcemap = { ["main.lua"] = ${mapping} };
375-
local __real_tb = debug.traceback
376-
debug.traceback = function() return ${JSON.stringify(fakeTraceback)} end
377-
`)
379+
.setLuaHeader(header)
378380
.setOptions({ sourceMapTraceback: true });
379381

380382
const lua = builder.getMainLuaCodeChunk();

0 commit comments

Comments
 (0)
X Tutup