diff --git a/src/client/app/widgets/common/widget.js b/src/client/app/widgets/common/widget.js index 4d979502..45260bfb 100644 --- a/src/client/app/widgets/common/widget.js +++ b/src/client/app/widgets/common/widget.js @@ -599,7 +599,7 @@ class Widget extends EventEmitter { return typeof r != 'string' ? JSON.stringify(r) : r }) } catch (err) { - propValue = 'ERROR' + propValue = 'ERROR (F12)' console.log(this.getProp('id') + '.' + propName + ': #{} error:\n' + err) } @@ -616,7 +616,7 @@ class Widget extends EventEmitter { }) } catch (err) { - propValue = 'ERROR' + propValue = 'ERROR (F12)' var stackline = err.stack ? (err.stack.match(/>:([0-9]+):[0-9]+/) || '') : '', line = stackline.length > 1 ? ' at line ' + (parseInt(stackline[1]) - 2) : '' console.log(this.getProp('id') + '.' + propName + ': JS{{}} error:\n' + err + line) diff --git a/src/client/app/widgets/utils.js b/src/client/app/widgets/utils.js index 1c4e8cdf..3843b033 100644 --- a/src/client/app/widgets/utils.js +++ b/src/client/app/widgets/utils.js @@ -132,6 +132,10 @@ module.exports = { parsers = {} sandbox.contentWindow.console = console + sandbox.contentWindow.setTimeout = + sandbox.contentWindow.setInterval = ()=>{ + throw 'setTimeout and setInterval can\'t be used in formulas' + } sandbox.contentWindow.global = {} document.documentElement.removeChild(sandbox)