tutuca 0.9.111 → 0.9.112

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.
@@ -540,7 +540,6 @@ var PREDICATES = {
540
540
 
541
541
  class ValParser {
542
542
  constructor() {
543
- this.bindValIt = new BindVal("it");
544
543
  this.nullConstVal = new ConstVal(null);
545
544
  }
546
545
  const(v) {
@@ -2086,7 +2085,7 @@ function parseXOp(attrs, childs, opIdx, px) {
2086
2085
  node = px.addNodeIf(RenderNode, parseXOpVal(name, value, px, vp.parseComponent), as);
2087
2086
  break;
2088
2087
  case "render-it":
2089
- node = px.addNodeIf(RenderItNode, vp.bindValIt, as);
2088
+ node = px.addNode(RenderItNode, as);
2090
2089
  break;
2091
2090
  case "render-each":
2092
2091
  node = parseRenderEach(px, value, as, attrs);
@@ -2269,7 +2268,7 @@ function parseRenderEach(px, value, as, attrs) {
2269
2268
  const seqVal = parseXOpVal("render-each", value, px, vp.parseSequence);
2270
2269
  if (seqVal === null)
2271
2270
  return null;
2272
- const renderIt = px.addNodeIf(RenderItNode, vp.bindValIt, as);
2271
+ const renderIt = px.addNode(RenderItNode, as);
2273
2272
  const attrParser = getAttrParser(px);
2274
2273
  const eachAttr = attrParser.eachAttr = attrParser.pushWrapper("each", value, seqVal);
2275
2274
  const when = attrs.getNamedItem("@when") ?? attrs.getNamedItem("when");
@@ -2469,6 +2468,12 @@ class ParseContext {
2469
2468
  }
2470
2469
  return null;
2471
2470
  }
2471
+ addNode(Class, extra) {
2472
+ const nodeId = this.nodes.length;
2473
+ const node = new Class(nodeId, null, extra);
2474
+ this.nodes.push(node);
2475
+ return node;
2476
+ }
2472
2477
  registerEvents() {
2473
2478
  const id = this.events.length;
2474
2479
  const events = new NodeEvents(id);
@@ -2900,7 +2905,7 @@ class Stack {
2900
2905
  return new Stack(comps, it, binds, newDynBinds, views, viewsId, ctx);
2901
2906
  }
2902
2907
  static root(comps, it, ctx) {
2903
- const binds = [new BindFrame(it, { it }, true), null];
2908
+ const binds = [new BindFrame(it, {}, true), null];
2904
2909
  const dynBinds = [new ObjectFrame({}), null];
2905
2910
  const views = ["main", null];
2906
2911
  return new Stack(comps, it, binds, dynBinds, views, "", ctx)._pushProvides();
package/dist/tutuca.js CHANGED
@@ -4911,7 +4911,6 @@ var PREDICATES = {
4911
4911
 
4912
4912
  class ValParser {
4913
4913
  constructor() {
4914
- this.bindValIt = new BindVal("it");
4915
4914
  this.nullConstVal = new ConstVal(null);
4916
4915
  }
4917
4916
  const(v) {
@@ -6454,7 +6453,7 @@ function parseXOp(attrs, childs, opIdx, px) {
6454
6453
  node = px.addNodeIf(RenderNode, parseXOpVal(name, value, px, vp.parseComponent), as);
6455
6454
  break;
6456
6455
  case "render-it":
6457
- node = px.addNodeIf(RenderItNode, vp.bindValIt, as);
6456
+ node = px.addNode(RenderItNode, as);
6458
6457
  break;
6459
6458
  case "render-each":
6460
6459
  node = parseRenderEach(px, value, as, attrs);
@@ -6637,7 +6636,7 @@ function parseRenderEach(px, value, as, attrs) {
6637
6636
  const seqVal = parseXOpVal("render-each", value, px, vp.parseSequence);
6638
6637
  if (seqVal === null)
6639
6638
  return null;
6640
- const renderIt = px.addNodeIf(RenderItNode, vp.bindValIt, as);
6639
+ const renderIt = px.addNode(RenderItNode, as);
6641
6640
  const attrParser = getAttrParser(px);
6642
6641
  const eachAttr = attrParser.eachAttr = attrParser.pushWrapper("each", value, seqVal);
6643
6642
  const when = attrs.getNamedItem("@when") ?? attrs.getNamedItem("when");
@@ -6837,6 +6836,12 @@ class ParseContext {
6837
6836
  }
6838
6837
  return null;
6839
6838
  }
6839
+ addNode(Class, extra) {
6840
+ const nodeId = this.nodes.length;
6841
+ const node = new Class(nodeId, null, extra);
6842
+ this.nodes.push(node);
6843
+ return node;
6844
+ }
6840
6845
  registerEvents() {
6841
6846
  const id = this.events.length;
6842
6847
  const events = new NodeEvents(id);
@@ -7268,7 +7273,7 @@ class Stack2 {
7268
7273
  return new Stack2(comps, it, binds, newDynBinds, views, viewsId, ctx);
7269
7274
  }
7270
7275
  static root(comps, it, ctx) {
7271
- const binds = [new BindFrame(it, { it }, true), null];
7276
+ const binds = [new BindFrame(it, {}, true), null];
7272
7277
  const dynBinds = [new ObjectFrame({}), null];
7273
7278
  const views = ["main", null];
7274
7279
  return new Stack2(comps, it, binds, dynBinds, views, "", ctx)._pushProvides();