gyosjs 0.3.1 → 0.3.2

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/dist/gyos.auto.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * GyosJS v0.3.1
2
+ * GyosJS v0.3.2
3
3
  * (c) 2026
4
4
  * @license MIT
5
5
  */
@@ -5189,6 +5189,10 @@
5189
5189
  const structuralElements = [];
5190
5190
  const root = elements[0];
5191
5191
  elements.forEach(el => {
5192
+ // Await branches are detached and parsed only after their alias scope exists.
5193
+ // Do not evaluate nested structural expressions during the parent scan.
5194
+ if (isAwaitBranchDescendant(el))
5195
+ return;
5192
5196
  const hasIf = el.hasAttribute('*if');
5193
5197
  const hasFor = el.hasAttribute('*for');
5194
5198
  const hasSwitch = el.hasAttribute('*switch');
@@ -5233,6 +5237,20 @@
5233
5237
  }
5234
5238
  });
5235
5239
  }
5240
+ function isAwaitBranchDescendant(element) {
5241
+ let child = element;
5242
+ let parent = element.parentElement;
5243
+ while (parent && parent !== document.body) {
5244
+ if (parent.hasAttribute('*await') && (child.hasAttribute('*pending') ||
5245
+ child.hasAttribute('*then') ||
5246
+ child.hasAttribute('*catch'))) {
5247
+ return true;
5248
+ }
5249
+ child = parent;
5250
+ parent = parent.parentElement;
5251
+ }
5252
+ return false;
5253
+ }
5236
5254
  const elementBelongsToAnotherScope = (el, scope) => {
5237
5255
  const owner = getScopeFromElement(el);
5238
5256
  return Boolean(owner && owner !== scope);
@@ -8529,7 +8547,7 @@
8529
8547
  portalCreate,
8530
8548
  portalDestroy,
8531
8549
  setCspNonce,
8532
- version: '0.3.1'
8550
+ version: '0.3.2'
8533
8551
  };
8534
8552
 
8535
8553
  const standardExpressionRuntime = {