From 8cd4d3e80dbe518abcfcc01845b5beeff2959ba1 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Wed, 17 Sep 2025 11:36:05 -0500 Subject: [PATCH 1/2] declare textValues before setting. --- js/common/plotter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/common/plotter.js b/js/common/plotter.js index c80a8e8..1768224 100644 --- a/js/common/plotter.js +++ b/js/common/plotter.js @@ -45,6 +45,7 @@ export function plotValues(chartObj, serialMessage, bufferSize) { } let valuesToPlot; + let textValues; // handle possible tuple in textLine if (textLine.startsWith("(") && textLine.endsWith(")")) { From db35a85239e1aebbb92af683e1446fe3e5687e6e Mon Sep 17 00:00:00 2001 From: foamyguy Date: Wed, 17 Sep 2025 16:04:23 -0500 Subject: [PATCH 2/2] move declaration to inner scope --- js/common/plotter.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/common/plotter.js b/js/common/plotter.js index 1768224..f0e6303 100644 --- a/js/common/plotter.js +++ b/js/common/plotter.js @@ -45,11 +45,10 @@ export function plotValues(chartObj, serialMessage, bufferSize) { } let valuesToPlot; - let textValues; // handle possible tuple in textLine if (textLine.startsWith("(") && textLine.endsWith(")")) { - textValues = textLine.substring(1, textLine.length - 1).trim(); + let textValues = textLine.substring(1, textLine.length - 1).trim(); // Python tuples can end with a comma, but JS arrays cannot if (textValues.endsWith(",")) { textValues = textValues.substring(0, textValues.length - 1);