@@ -34,6 +34,7 @@ let container = {
3434 /** @type {Result | null } */
3535 result : null ,
3636 sharedKeys : new Set ( ) , // Track keys shared via share() function
37+ tsFileMapping : null , // TypeScript file mapping for error stack fixing
3738}
3839
3940/**
@@ -176,6 +177,15 @@ class Container {
176177 return container . translation
177178 }
178179
180+ /**
181+ * Get TypeScript file mapping for error stack fixing
182+ *
183+ * @api
184+ */
185+ static tsFileMapping ( ) {
186+ return container . tsFileMapping
187+ }
188+
179189 /**
180190 * Get Mocha instance
181191 *
@@ -415,6 +425,8 @@ async function requireHelperFromModule(helperName, config, HelperClass) {
415425 importPath = tempFile
416426 tempJsFile = allTempFiles
417427 fileMapping = mapping
428+ // Store file mapping in container for runtime error fixing
429+ container . tsFileMapping = mapping
418430 } catch ( tsError ) {
419431 throw new Error ( `Failed to load TypeScript helper ${ importPath } : ${ tsError . message } . Make sure 'typescript' package is installed.` )
420432 }
@@ -757,6 +769,8 @@ async function loadSupportObject(modulePath, supportObjectName) {
757769 // Store temp files list in a way that cleanup can access them
758770 tempJsFile = allTempFiles
759771 fileMapping = mapping
772+ // Store file mapping in container for runtime error fixing
773+ container . tsFileMapping = mapping
760774 } catch ( tsError ) {
761775 throw new Error ( `Failed to load TypeScript file ${ importPath } : ${ tsError . message } . Make sure 'typescript' package is installed.` )
762776 }
0 commit comments