mathjs: print deprecation warning for each widget

This commit is contained in:
bordun 2020-01-27 08:44:32 +01:00
parent dd5d58af57
commit 60cd50f9d5

View file

@ -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)