Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Guard access to node.key when finding displayName #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stephen
Copy link

@stephen stephen commented Jun 22, 2016

This PR addresses an issue where use of the spread operator inside of a component spec causes getDisplayName to fail, since SpreadOperator nodes don't have a key property.

Example class:

const definition = {};
React.createClass({
  ...definition,
  displayName: 'TestClass',
});

Error output:

TypeError: Cannot read property 'name' of undefined while parsing file: <file>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant