SVGHMI: avoid Widget's member name colision in between enable expressions and assignments.
authorEdouard Tisserant
Wed, 23 Nov 2022 11:30:30 +0100
changeset 3686 a3c509e66695
parent 3685 570a738239f4
child 3687 747ffdafbe31
SVGHMI: avoid Widget's member name colision in between enable expressions and assignments.
svghmi/widgets_common.ysl2
--- a/svghmi/widgets_common.ysl2	Wed Nov 23 11:27:55 2022 +0100
+++ b/svghmi/widgets_common.ysl2	Wed Nov 23 11:30:30 2022 +0100
@@ -134,7 +134,7 @@
     |   "«@id»": new «$widget/@type»Widget ("«@id»",«$freq»,[«$args»],[«$variables»],«$enable_expr»,{
     if "$widget/@enable_expr" {
 
-    |       assignments: [],
+    |       enable_assignments: [],
     |       compute_enable: function(value, oldval, varnum) {
     |         let result = false;
     |         do {
@@ -142,8 +142,8 @@
             const "varid","generate-id()";
             const "varnum","position()-1";
             if "@assign" foreach "$widget/path[@assign]" if "$varid = generate-id()" {
-    |           if(varnum == «$varnum») this.assignments[«position()-1»] = value;
-    |           let «@assign» = this.assignments[«position()-1»];
+    |           if(varnum == «$varnum») this.enable_assignments[«position()-1»] = value;
+    |           let «@assign» = this.enable_assignments[«position()-1»];
     |           if(«@assign» == undefined) break;
             }
         }