@o-lang/olang 1.2.32 → 1.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1258,9 +1258,14 @@ const forbiddenPatterns = [
|
|
|
1258
1258
|
throw new Error(errorMessage);
|
|
1259
1259
|
};
|
|
1260
1260
|
|
|
1261
|
-
|
|
1261
|
+
switch (stepType) {
|
|
1262
1262
|
case 'calculate': {
|
|
1263
|
-
|
|
1263
|
+
// ✅ Interpolate variables in the expression before evaluation
|
|
1264
|
+
let expr = step.expression || step.actionRaw;
|
|
1265
|
+
if (typeof expr === 'string' && expr.includes('{')) {
|
|
1266
|
+
expr = this._safeInterpolate(expr, this.context, 'calculate step');
|
|
1267
|
+
}
|
|
1268
|
+
const result = this.evaluateMath(expr);
|
|
1264
1269
|
if (step.saveAs) this.context[step.saveAs] = result;
|
|
1265
1270
|
break;
|
|
1266
1271
|
}
|