mevento 1.9.9 → 2.0.0

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.
@@ -1415,15 +1415,16 @@ class MEvento extends NodeVisitor {
1415
1415
  }
1416
1416
  }
1417
1417
  visitRootAST(node) {
1418
+ var _a;
1418
1419
  const list = node.body;
1419
1420
  let last;
1420
1421
  for (const n of list) {
1421
1422
  last = this.visit(n);
1422
1423
  if (last instanceof ReturnBranch) {
1423
- return last.value;
1424
+ return (_a = last.value) !== null && _a !== void 0 ? _a : null;
1424
1425
  }
1425
1426
  }
1426
- return last;
1427
+ return last !== null && last !== void 0 ? last : null;
1427
1428
  }
1428
1429
  visitBlockStatementAST(node) {
1429
1430
  const list = node.body;
@@ -1439,7 +1440,7 @@ class MEvento extends NodeVisitor {
1439
1440
  }
1440
1441
  }
1441
1442
  this.popScope();
1442
- return last;
1443
+ return last !== null && last !== void 0 ? last : null;
1443
1444
  }
1444
1445
  visitIdentifierAST(node) {
1445
1446
  var _a;
@@ -1603,6 +1604,7 @@ class MEvento extends NodeVisitor {
1603
1604
  return null;
1604
1605
  }
1605
1606
  visitIndexAccessorAST(node) {
1607
+ var _a, _b;
1606
1608
  const ownerNode = node.owner;
1607
1609
  const owner = this.visit(ownerNode);
1608
1610
  if (owner === null || owner === undefined) {
@@ -1610,11 +1612,11 @@ class MEvento extends NodeVisitor {
1610
1612
  }
1611
1613
  if (typeof owner === 'object') {
1612
1614
  const key = this.visit(node.key);
1613
- return owner[key];
1615
+ return (_a = owner[key]) !== null && _a !== void 0 ? _a : null;
1614
1616
  }
1615
1617
  else if (Array.isArray(owner)) {
1616
1618
  const key = this.visit(node.key);
1617
- return isNum(key) && owner.length < key && key >= 0 ? owner[key] : null;
1619
+ return isNum(key) && owner.length < key && key >= 0 ? (_b = owner[key]) !== null && _b !== void 0 ? _b : null : null;
1618
1620
  }
1619
1621
  return null;
1620
1622
  }
@@ -1822,16 +1824,17 @@ class MEventoAsync extends MEvento {
1822
1824
  super();
1823
1825
  }
1824
1826
  visitRootAST(node) {
1827
+ var _a;
1825
1828
  return __awaiter(this, void 0, void 0, function* () {
1826
1829
  const list = node.body;
1827
1830
  let last;
1828
1831
  for (const n of list) {
1829
1832
  last = yield this.visit(n);
1830
1833
  if (last instanceof ReturnBranch) {
1831
- return last.value;
1834
+ return (_a = last.value) !== null && _a !== void 0 ? _a : null;
1832
1835
  }
1833
1836
  }
1834
- return last;
1837
+ return last !== null && last !== void 0 ? last : null;
1835
1838
  });
1836
1839
  }
1837
1840
  visitBlockStatementAST(node) {
@@ -2031,6 +2034,7 @@ class MEventoAsync extends MEvento {
2031
2034
  });
2032
2035
  }
2033
2036
  visitIndexAccessorAST(node) {
2037
+ var _a, _b;
2034
2038
  return __awaiter(this, void 0, void 0, function* () {
2035
2039
  const ownerNode = node.owner;
2036
2040
  const owner = yield this.visit(ownerNode);
@@ -2039,11 +2043,11 @@ class MEventoAsync extends MEvento {
2039
2043
  }
2040
2044
  if (typeof owner === 'object') {
2041
2045
  const key = yield this.visit(node.key);
2042
- return owner[key];
2046
+ return (_a = owner[key]) !== null && _a !== void 0 ? _a : null;
2043
2047
  }
2044
2048
  else if (Array.isArray(owner)) {
2045
2049
  const key = yield this.visit(node.key);
2046
- return isNum(key) && owner.length < key && key >= 0 ? owner[key] : null;
2050
+ return isNum(key) && owner.length < key && key >= 0 ? (_b = owner[key]) !== null && _b !== void 0 ? _b : null : null;
2047
2051
  }
2048
2052
  return null;
2049
2053
  });