From 60cd50f9d583e2186ab423f8c5d0fddbe2f3b42b Mon Sep 17 00:00:00 2001 From: bordun Date: Mon, 27 Jan 2020 08:44:32 +0100 Subject: [PATCH] mathjs: print deprecation warning for each widget --- src/client/app/widgets/common/widget.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/app/widgets/common/widget.js b/src/client/app/widgets/common/widget.js index 903a054e..d3958416 100644 --- a/src/client/app/widgets/common/widget.js +++ b/src/client/app/widgets/common/widget.js @@ -13,7 +13,6 @@ var EventEmitter = require('../../events/event-emitter'), updateWidget = ()=>{} -var mathjsDeprecationWarned = false var oscReceiverState = {} var OSCProps = [ @@ -161,6 +160,7 @@ class Widget extends EventEmitter { } this.disabledProps = [] + this.mathjsDeprecationWarned = false // cache precision if (this.props.precision != undefined) { @@ -586,9 +586,9 @@ class Widget extends EventEmitter { propValue = propValue.replace(/#\{(?:[^{}]|\{[^{}]*\})*\}/g, (m)=>{ // one bracket nesting allowed, if we need two: #\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\} - if (!mathjsDeprecationWarned) { - mathjsDeprecationWarned = true - ipc.send('error', 'Warning: MathJS syntax (#{}) is deprecated and will be removed in the future. Consider using the Javascript syntax instead.') + if (!this.mathjsDeprecationWarned) { + this.mathjsDeprecationWarned = true + ipc.send('error', `Warning: Widget#${this.getProp('id')} MathJS syntax (#{}) is deprecated and will be removed in the future. Consider using the Javascript syntax instead.`) } // unescape brackets (not needed anymore, just here for backward compatibility)