File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments