console: attempt to fix line numbers in script errors

This commit is contained in:
jean-emmanuel 2021-12-13 18:56:49 +01:00
parent 9aade43059
commit 7c654e6412

View file

@ -964,7 +964,7 @@ class Widget extends EventEmitter {
errorProp(name, type, error) {
let stackline = error.stack ? (error.stack.match(/>:([0-9]+):[0-9]+/) || '') : '',
line = stackline.length > 1 ? ' at line ' + (parseInt(stackline[1]) - (type.includes('{}') ? 1 : 0)) : '',
line = stackline.length > 1 ? ' at line ' + (parseInt(stackline[1]) - (type.includes('{}') ? 1 : 2)) : '',
id = this.getProp('id') || this.props.id,
widget = this // used for edit link in console