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.esm.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
  */
@@ -5215,6 +5215,10 @@ function processStructuralDirectives(elements, scope) {
5215
5215
  const structuralElements = [];
5216
5216
  const root = elements[0];
5217
5217
  elements.forEach(el => {
5218
+ // Await branches are detached and parsed only after their alias scope exists.
5219
+ // Do not evaluate nested structural expressions during the parent scan.
5220
+ if (isAwaitBranchDescendant(el))
5221
+ return;
5218
5222
  const hasIf = el.hasAttribute('*if');
5219
5223
  const hasFor = el.hasAttribute('*for');
5220
5224
  const hasSwitch = el.hasAttribute('*switch');
@@ -5259,6 +5263,20 @@ function processStructuralDirectives(elements, scope) {
5259
5263
  }
5260
5264
  });
5261
5265
  }
5266
+ function isAwaitBranchDescendant(element) {
5267
+ let child = element;
5268
+ let parent = element.parentElement;
5269
+ while (parent && parent !== document.body) {
5270
+ if (parent.hasAttribute('*await') && (child.hasAttribute('*pending') ||
5271
+ child.hasAttribute('*then') ||
5272
+ child.hasAttribute('*catch'))) {
5273
+ return true;
5274
+ }
5275
+ child = parent;
5276
+ parent = parent.parentElement;
5277
+ }
5278
+ return false;
5279
+ }
5262
5280
  const elementBelongsToAnotherScope = (el, scope) => {
5263
5281
  const owner = getScopeFromElement(el);
5264
5282
  return Boolean(owner && owner !== scope);
@@ -8555,7 +8573,7 @@ const Gyos = {
8555
8573
  portalCreate,
8556
8574
  portalDestroy,
8557
8575
  setCspNonce,
8558
- version: '0.3.1'
8576
+ version: '0.3.2'
8559
8577
  };
8560
8578
 
8561
8579
  setExpressionRuntime(standardExpressionRuntime);