eclipsesource / eclipsesource/tabris-js
SourceMap Support: Stack Traces can be "double mapped" in some cases
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 171
- PR merge metrics
- No merged PRs in 30d
Description
This issue may occur if an app does something like this:
```js
try {
try {
...
} catch (ex) {
throw new Error('Some error happend:' + ex.toString())
}
catch (ex) {
console.error(ex.toString());
}
```
`ex.toString()` always includes a message and a mapped stack trace. In the inner error message this becomes part of a new error, which is then itself mapped to print to console.error. However, at least on android/V8 the stack trace (ex.stack) always also includes the error message itself. To differenciate between the message and an actual stack line the mapping logic checks each line with a regular expression, which happens to apply to an already mapped line, thus attempting to map it again. However, it likely will always fail to load the source map since the mapped url is used for that. If the url contains special characters the end result can be messages like this:
`Error loading source map ./node_modules/tabris-decorators/webpack:/src/internals/processTwoWayBinding.ts`
The stack trace will still be printed, so this is propably not a critical issue.
Contributor guide
Assessment
This issue has not been assessed yet.