@fairfox/polly 0.77.0 → 0.77.1

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.
@@ -2541,6 +2541,9 @@ var init_tla = __esm(() => {
2541
2541
  const paramName = value.substring(6);
2542
2542
  return `payload.${this.sanitizeFieldName(paramName)}`;
2543
2543
  }
2544
+ if (value.startsWith("EXPR:")) {
2545
+ return this.tsExpressionToTLA(value.substring(5), false);
2546
+ }
2544
2547
  if (this.isTLAExpression(value)) {
2545
2548
  return this.sanitizeTLAExpression(value);
2546
2549
  }
@@ -5833,7 +5836,19 @@ class HandlerExtractor {
5833
5836
  const paramName = this.extractPayloadPropertyParam(initializer);
5834
5837
  if (paramName !== null) {
5835
5838
  assignments.push({ field, value: `param:${paramName}` });
5839
+ return;
5840
+ }
5841
+ if (this.isTranslatableInitializer(initializer)) {
5842
+ assignments.push({ field, value: `EXPR:${initializer.getText()}` });
5843
+ return;
5836
5844
  }
5845
+ if (process.env["POLLY_DEBUG"]) {
5846
+ const on = signalName ? ` on ${signalName}.value` : "";
5847
+ console.log(`[WARN] dropped object-literal property '${name}'${on} — initializer kind ${initializer.getKindName()} is not translatable to TLA+`);
5848
+ }
5849
+ }
5850
+ isTranslatableInitializer(node) {
5851
+ return Node2.isBinaryExpression(node) || Node2.isPropertyAccessExpression(node) || Node2.isElementAccessExpression(node) || Node2.isPrefixUnaryExpression(node) || Node2.isPostfixUnaryExpression(node) || Node2.isParenthesizedExpression(node);
5837
5852
  }
5838
5853
  extractPayloadPropertyParam(initializer) {
5839
5854
  if (!Node2.isPropertyAccessExpression(initializer))
@@ -8373,4 +8388,4 @@ main().catch((error) => {
8373
8388
  process.exit(1);
8374
8389
  });
8375
8390
 
8376
- //# debugId=CD834265BD94F24164756E2164756E21
8391
+ //# debugId=2F2FDDDA92F1E27664756E2164756E21