bobe 0.0.74 → 0.0.76

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.
@@ -359,9 +359,7 @@ class Tokenizer {
359
359
  return this.token;
360
360
  } catch (error) {
361
361
  throw error;
362
- } finally {
363
- this.handledTokens.push(this.token);
364
- }
362
+ } finally {}
365
363
  }
366
364
  locStart() {
367
365
  {
@@ -405,7 +403,6 @@ class Tokenizer {
405
403
  }
406
404
  const trimmed = value.replace(/\/\/[\s\S]+/, '').trim();
407
405
  this.setToken(TokenType.Identifier, trimmed ? trimmed : true, 0);
408
- this.handledTokens.push(this.token);
409
406
  this.locEnd();
410
407
  return this.token;
411
408
  }
@@ -426,7 +423,6 @@ class Tokenizer {
426
423
  char = this.code[this.i];
427
424
  }
428
425
  this.setToken(TokenType.Identifier, value, 0);
429
- this.handledTokens.push(this.token);
430
426
  this.locEnd();
431
427
  return this.token;
432
428
  }
@@ -2365,10 +2361,19 @@ class Interpreter {
2365
2361
  }
2366
2362
  removeForItem(children, i) {
2367
2363
  const child = children[i];
2364
+ const after = child.realAfter;
2368
2365
  this.removeLogicNode(child);
2369
2366
  this.remove(child.realBefore);
2370
2367
  this.remove(child.realAfter);
2371
2368
  child.effect.dispose();
2369
+ child.effect = undefined;
2370
+ child.data = undefined;
2371
+ child.context = undefined;
2372
+ after[FakeNode] = undefined;
2373
+ child.forNode = undefined;
2374
+ child.realParent = undefined;
2375
+ child.realAfter = undefined;
2376
+ child.realBefore = undefined;
2372
2377
  }
2373
2378
  reuseForItem(child, data, itemExp, i, indexName, indexValue) {
2374
2379
  if (typeof itemExp === 'string') {
@@ -2527,6 +2532,11 @@ class Interpreter {
2527
2532
  getFn(data, expression) {
2528
2533
  return new Function('data', `with(data){return (${expression})}`).bind(undefined, safe(data));
2529
2534
  }
2535
+ getBoolFn(data, expression) {
2536
+ return new Function('data', `with(data){return Boolean(${expression})}`).bind(undefined, safeExclude(data, {
2537
+ 'Boolean': true
2538
+ }));
2539
+ }
2530
2540
  getAssignFn(data, expression) {
2531
2541
  const valueId = `value_bobe_${bobeShared.date32()}`;
2532
2542
  return new Function('data', valueId, `with(data){${expression}=${valueId}};`).bind(undefined, safeExclude(data, {
@@ -2564,11 +2574,9 @@ class Interpreter {
2564
2574
  switch (keyWord.value) {
2565
2575
  case 'if':
2566
2576
  if (valueIsMapKey) {
2567
- aoye.runWithPulling(() => data[value], null);
2568
- const cells = data[aoye.Keys.Meta].cells;
2569
- signal = cells.get(value);
2577
+ signal = new aoye.Computed(() => Boolean(data[value]));
2570
2578
  } else {
2571
- const fn = this.getFn(data, value);
2579
+ const fn = this.getBoolFn(data, value);
2572
2580
  signal = new aoye.Computed(fn);
2573
2581
  }
2574
2582
  break;
@@ -2588,7 +2596,7 @@ class Interpreter {
2588
2596
  return true;
2589
2597
  });
2590
2598
  } else {
2591
- const fn = valueIsMapKey ? null : this.getFn(data, value);
2599
+ const fn = valueIsMapKey ? null : this.getBoolFn(data, value);
2592
2600
  signal = new aoye.Computed(() => {
2593
2601
  let point = ifNode.preCond;
2594
2602
  while (point) {
@@ -2600,7 +2608,7 @@ class Interpreter {
2600
2608
  }
2601
2609
  point = point.preCond;
2602
2610
  }
2603
- return valueIsMapKey ? data[value] : fn();
2611
+ return valueIsMapKey ? Boolean(data[value]) : fn();
2604
2612
  });
2605
2613
  }
2606
2614
  break;