11import * as util from "../util" ;
2+ import * as tstl from "../../src" ;
23
34test ( "throwString" , ( ) => {
45 util . testFunction `
@@ -354,8 +355,10 @@ test("subclass Error", () => {
354355 . expectToMatchJsResult ( ) ;
355356} ) ;
356357
357- test . each ( [ "Error" , "RangeError" , "MyError" ] ) ( "get stack from error" , errorType => {
358- const stack = util . testFunction `
358+ test . each ( [ [ "Error" , false ] , [ "Error" , true ] , [ "RangeError" , false ] , [ "MyError" , false ] ] as Array < [ string , boolean ] > ) (
359+ "get stack from error" ,
360+ ( errorType , sourceMapTraceback ) => {
361+ const stack = util . testFunction `
359362 class MyError extends Error {
360363 name: "MyError"
361364 }
@@ -373,9 +376,11 @@ test.each(["Error", "RangeError", "MyError"])("get stack from error", errorType
373376 }
374377 }
375378 `
376- . expectNoExecutionError ( )
377- . getLuaExecutionResult ( ) ;
379+ . setOptions ( { sourceMapTraceback, luaLibImport : tstl . LuaLibImportKind . Inline } )
380+ . expectNoExecutionError ( )
381+ . getLuaExecutionResult ( ) ;
378382
379- expect ( stack ) . toMatch ( "innerFunctionThatThrows" ) ;
380- expect ( stack ) . toMatch ( "outerFunctionThatThrows" ) ;
381- } ) ;
383+ expect ( stack ) . toMatch ( "innerFunctionThatThrows" ) ;
384+ expect ( stack ) . toMatch ( "outerFunctionThatThrows" ) ;
385+ }
386+ ) ;
0 commit comments