@torpor/view 1.2.1 → 1.2.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/compile.cjs CHANGED
@@ -1084,9 +1084,22 @@ function declareControlFragmentVars(fragment, node, path, status, b, parentName,
1084
1084
  case "@html group":
1085
1085
  declareParentAndAnchorFragmentVars(fragment, node, path, status, b, parentName, anchorName, varPaths, node.operation.substring(1).replace(" group", ""), declare);
1086
1086
  break;
1087
- default: for (let [i, child] of node.children.entries()) declareFragmentVars(fragment, child, path, status, b, parentName, anchorName, varPaths, i === node.children.length - 1, declare);
1087
+ default:
1088
+ if (SCRIPT_OPERATIONS.has(node.operation)) {
1089
+ buildNode(node, status, b, parentName, anchorName);
1090
+ node.handled = true;
1091
+ break;
1092
+ }
1093
+ for (let [i, child] of node.children.entries()) declareFragmentVars(fragment, child, path, status, b, parentName, anchorName, varPaths, i === node.children.length - 1, declare);
1088
1094
  }
1089
1095
  }
1096
+ const SCRIPT_OPERATIONS = /* @__PURE__ */ new Set([
1097
+ "@const",
1098
+ "@console",
1099
+ "@debugger",
1100
+ "@function",
1101
+ "@async function"
1102
+ ]);
1090
1103
  function declareComponentFragmentVars(fragment, node, path, status, b, parentName, anchorName, varPaths, declare) {
1091
1104
  declareParentAndAnchorFragmentVars(fragment, node, path, status, b, parentName, anchorName, varPaths, "comp", declare);
1092
1105
  }
package/dist/compile.mjs CHANGED
@@ -1083,9 +1083,22 @@ function declareControlFragmentVars(fragment, node, path, status, b, parentName,
1083
1083
  case "@html group":
1084
1084
  declareParentAndAnchorFragmentVars(fragment, node, path, status, b, parentName, anchorName, varPaths, node.operation.substring(1).replace(" group", ""), declare);
1085
1085
  break;
1086
- default: for (let [i, child] of node.children.entries()) declareFragmentVars(fragment, child, path, status, b, parentName, anchorName, varPaths, i === node.children.length - 1, declare);
1086
+ default:
1087
+ if (SCRIPT_OPERATIONS.has(node.operation)) {
1088
+ buildNode(node, status, b, parentName, anchorName);
1089
+ node.handled = true;
1090
+ break;
1091
+ }
1092
+ for (let [i, child] of node.children.entries()) declareFragmentVars(fragment, child, path, status, b, parentName, anchorName, varPaths, i === node.children.length - 1, declare);
1087
1093
  }
1088
1094
  }
1095
+ const SCRIPT_OPERATIONS = /* @__PURE__ */ new Set([
1096
+ "@const",
1097
+ "@console",
1098
+ "@debugger",
1099
+ "@function",
1100
+ "@async function"
1101
+ ]);
1089
1102
  function declareComponentFragmentVars(fragment, node, path, status, b, parentName, anchorName, varPaths, declare) {
1090
1103
  declareParentAndAnchorFragmentVars(fragment, node, path, status, b, parentName, anchorName, varPaths, "comp", declare);
1091
1104
  }