From 7c654e6412e26908118868336ca712d75d763ee0 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 13 Dec 2021 18:56:49 +0100 Subject: [PATCH] console: attempt to fix line numbers in script errors --- src/client/widgets/common/widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 43274391..8cd72758 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -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