@babel/traverse 8.0.0-alpha.3 → 8.0.0-alpha.4

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
@@ -2460,7 +2460,10 @@ function _evaluate(path, state) {
2460
2460
  const property = callee.get("property");
2461
2461
  if (object.isIdentifier() && property.isIdentifier() && isValidObjectCallee(object.node.name) && !isInvalidMethod(property.node.name)) {
2462
2462
  context = global[object.node.name];
2463
- func = context[property.node.name];
2463
+ const key = property.node.name;
2464
+ if (Object.hasOwnProperty.call(context, key)) {
2465
+ func = context[key];
2466
+ }
2464
2467
  }
2465
2468
  if (object.isLiteral() && property.isIdentifier()) {
2466
2469
  const type = typeof object.node.value;