node/test/fixtures/source-map/enclosing-call-site.js
bcoe 09fd8f13c8
errors: display original symbol name
If symbol names array has been populated in source map, include
original symbol name in error message.

Fixes https://github.com/nodejs/node/issues/35325

PR-URL: https://github.com/nodejs/node/pull/36042
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-01 07:23:56 -08:00

27 lines
334 B
JavaScript

const functionA = () => {
functionB()
}
function functionB() {
functionC()
}
const functionC = () => {
functionD()
}
const functionD = () => {
(function functionE () {
if (Math.random() > 0) {
throw new Error('an error!')
}
})()
}
const thrower = functionA
try {
thrower()
} catch (err) {
throw err
}