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

Prevent crashes when working with ES2015 symbols #21

Merged
merged 1 commit into from
Mar 28, 2016

Conversation

codeheroics
Copy link
Contributor

redux-devtools-inspector crashed when using symbols.

The two following things caused the crashes:

  • javascript-stringify did not support symbols whereas the previously used jsan did. Here's the PR I sent them to fix this (merged).
  • getShortTypeString in ActionPreview.jsx did not support Symbols, so it tried using them as strings, which is not supported and caused the error Uncaught TypeError: Cannot convert a Symbol value to a string

This corrected, there is still a problem as Symbol values are not shown in JSONTree. Here's the PR I sent for this

I think this is what causes #17, though I'm not sure it is the only cause. I got it while sending a React element in an action payload, and React elements have a $$typeof: Symbol.for('react.element') property

@alexkuz
Copy link
Owner

alexkuz commented Mar 24, 2016

Thank you so much!
jsan always generates valid JSON (which we don't need here, actually), so it won't show functions, unless we use the special jsan format. I suggest we wait for approval of that PR in javascript-stringify.

@codeheroics
Copy link
Contributor Author

A new version of javascript-stringify with my modification was released, so I just updated the PR!

@alexkuz alexkuz merged commit e8426cd into alexkuz:master Mar 28, 2016
@alexkuz
Copy link
Owner

alexkuz commented Mar 28, 2016

@codeheroics published in v0.3.3. Thanks again!

@codeheroics codeheroics deleted the prevent-symbols-crash branch March 29, 2016 18:40
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.

2 participants