@babel/traverse 8.0.0-alpha.5 → 8.0.0-alpha.6

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/lib/index.js CHANGED
@@ -1632,10 +1632,10 @@ const {
1632
1632
  } = _t;
1633
1633
  function createUnionType(types) {
1634
1634
  {
1635
- if (isFlowType(types[0])) {
1635
+ if (types.every(v => isFlowType(v))) {
1636
1636
  return createFlowUnionType(types);
1637
1637
  }
1638
- if (isTSType(types[0])) {
1638
+ if (types.every(v => isTSType(v))) {
1639
1639
  return createTSUnionType(types);
1640
1640
  }
1641
1641
  }
@@ -3829,8 +3829,10 @@ function _removeFromScope() {
3829
3829
  Object.keys(bindings).forEach(name => this.scope.removeBinding(name));
3830
3830
  }
3831
3831
  function _callRemovalHooks() {
3832
- for (const fn of hooks) {
3833
- if (fn(this, this.parentPath)) return true;
3832
+ if (this.parentPath) {
3833
+ for (const fn of hooks) {
3834
+ if (fn(this, this.parentPath)) return true;
3835
+ }
3834
3836
  }
3835
3837
  }
3836
3838
  function _remove() {