scripting: deep copy custom variables to avoid unwanted mutations
This commit is contained in:
parent
86abea7a3a
commit
9bd3b9d186
2 changed files with 2 additions and 2 deletions
|
|
@ -746,7 +746,7 @@ class Widget extends EventEmitter {
|
|||
}
|
||||
}
|
||||
|
||||
var r = this.variables[name].value
|
||||
var r = deepCopy(this.variables[name].value)
|
||||
|
||||
var varname = 'VAR_' + varnumber
|
||||
varnumber--
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ class ScriptVm extends Vm {
|
|||
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
|
||||
if (widgets[i].variables[name]) return widgets[i].variables[name].value
|
||||
if (widgets[i].variables[name]) return deepCopy(widgets[i].variables[name].value)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue