Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Person is <<anonymous>> in IE, breaking tests #516

Closed
subtleGradient opened this issue Nov 11, 2013 · 2 comments · Fixed by #598
Closed

Person is <<anonymous>> in IE, breaking tests #516

subtleGradient opened this issue Nov 11, 2013 · 2 comments · Fixed by #598

Comments

@subtleGradient
Copy link
Contributor

Instance Types should throw for invalid instances.

Expected function to throw Invariant Violation: Invalid prop `testProp` supplied to `testComponent`, expected instance of `Person`. , but it threw Invariant Violation: Invalid prop `testProp` supplied to `testComponent`, expected instance of `<<anonymous>>`.

Expected function to throw Invariant Violation: Invalid prop `testProp` supplied to `testComponent`, expected instance of `Person`. , but it threw Invariant Violation: Invalid prop `testProp` supplied to `testComponent`, expected instance of `<<anonymous>>`.

Expected function to throw Invariant Violation: Invalid prop `testProp` supplied to `testComponent`, expected instance of `Person`. , but it threw Invariant Violation: Invalid prop `testProp` supplied to `testComponent`, expected instance of `<<anonymous>>`.
@zpao
Copy link
Member

zpao commented Nov 11, 2013

This is because we use fn.name (which is nonstandard) to get as good as possible invariants. In this case, I would be satisfied with a conditional in the test to set the right comparison string.

https://github.com/facebook/react/blob/master/src/core/ReactPropTypes.js#L128

@subtleGradient
Copy link
Contributor Author

👍

@zpao zpao closed this as completed in #598 Nov 27, 2013
zpao added a commit that referenced this issue Nov 27, 2013
Be resilient to fn.name not existing in IE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants