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.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
  */
@@ -5221,6 +5221,10 @@
5221
5221
  const structuralElements = [];
5222
5222
  const root = elements[0];
5223
5223
  elements.forEach(el => {
5224
+ // Await branches are detached and parsed only after their alias scope exists.
5225
+ // Do not evaluate nested structural expressions during the parent scan.
5226
+ if (isAwaitBranchDescendant(el))
5227
+ return;
5224
5228
  const hasIf = el.hasAttribute('*if');
5225
5229
  const hasFor = el.hasAttribute('*for');
5226
5230
  const hasSwitch = el.hasAttribute('*switch');
@@ -5265,6 +5269,20 @@
5265
5269
  }
5266
5270
  });
5267
5271
  }
5272
+ function isAwaitBranchDescendant(element) {
5273
+ let child = element;
5274
+ let parent = element.parentElement;
5275
+ while (parent && parent !== document.body) {
5276
+ if (parent.hasAttribute('*await') && (child.hasAttribute('*pending') ||
5277
+ child.hasAttribute('*then') ||
5278
+ child.hasAttribute('*catch'))) {
5279
+ return true;
5280
+ }
5281
+ child = parent;
5282
+ parent = parent.parentElement;
5283
+ }
5284
+ return false;
5285
+ }
5268
5286
  const elementBelongsToAnotherScope = (el, scope) => {
5269
5287
  const owner = getScopeFromElement(el);
5270
5288
  return Boolean(owner && owner !== scope);
@@ -8561,7 +8579,7 @@
8561
8579
  portalCreate,
8562
8580
  portalDestroy,
8563
8581
  setCspNonce,
8564
- version: '0.3.1'
8582
+ version: '0.3.2'
8565
8583
  };
8566
8584
 
8567
8585
  setExpressionRuntime(standardExpressionRuntime);