script: print warning when using advanced syntaxes in scripts.

This commit is contained in:
jean-emmanuel 2021-12-05 16:16:05 +01:00
parent 74fdf17efd
commit 16a87b5b0b

View file

@ -217,6 +217,9 @@ class Widget extends EventEmitter {
Script = Script || require('../scripts/script')
if (this.getProp('script') && !(this instanceof Script)) {
if (typeof this.props.script == 'string' && this.props.script.match(/OSC\{|@\{|VAR\{/)) {
this.errorProp('script', 'syntax', 'using advanced syntaxes in the script property is strongly discouraged and may result in unexpected behaviors.')
}
this.script = new Script({props:{
id: this.getProp('id') + '/script',
script: this.getProp('script'),