Open stevefan1999-personal opened 2 months ago
In order to get that you need a couple of things in place. We have them over at the friendly fork:
With those 2 thins in place you can use your own Error.prepareStackTrace hook and read the source map and replace the current trace.
@saghul cool thanks! did not know about that one...
In Den the user have an option to include a Typescript transpiler (https://github.com/swc-project/swc) and the file will get transpiled to Javascript and also have an option to include the source map as a comment so that stack traces can be correctly remapped, however currently QuickJS does not take account into this and will the location of the error is often shifted away due to transpilation. Would be nice to include a basic support for source map so we can correctly print the right stack trace location.
Maybe related to https://github.com/bellard/quickjs/issues/235