From 16a87b5b0b8fc5fc197866cd46cf40b856deea2f Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 5 Dec 2021 16:16:05 +0100 Subject: [PATCH] script: print warning when using advanced syntaxes in scripts. --- src/client/widgets/common/widget.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 09fe9316..5454155b 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -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'),