-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Find callsites that would call toString() if we pass attributes through #10416
Conversation
I didn’t add a test but I verified it works in the Babel standalone example. Note the intention is to not show this warning but only log it internally. |
I'm curious whether we want to try and get this merged/synced this week? @spicyj @sebmarkbage |
Even for open source releases leaving it in isn't a big deal because we already warn about unknown attributes (so people who read warnings don't have them). |
I guess we don't think arrays are problematic? Or would we not pass them through? |
@spicyj This block here should prevent it: |
This isn't finding things that we used to call E.g. This isn't detected as a custom var x = {valueOf(){ return 123; }} |
@sebmarkbage Ah man. I didn't think of |
It sounds like the next steps are:
I think we should consider continuing to work on it for 17.0, since steps 1-3 will require some time. I could be wrong, but I'd rather take the time to test this internally before releasing the change. |
*that said, I'll try to take this over and get it in anyway. |
fixing this as per Sebastian's feedback, because we want to find all objects and not just ones with 'toString' defined. Because there may be other corner cases and issues that are revealed.
Already landed this at FB using a work-around to do it quickly, and we are trying to collect the data we need to do the fixes. I'm still not sure we will get this process done in time for 16.0. |
Thanks @nhunzaker - really really really happy to be collaborating with you. :) |
Did the same manual test as @gaearon and it still fires as expected, although as he said, we don't really want to release this, but to add it for our own logging purposes. |
Landing this for now, but we are still working on this:
Hopefully will have an update by Monday or Tuesday about how this goes and what we can do next. |
The downside of merging #10385 is that we don’t know if we have internal callsites that would break because of
toString
once we start passing attributes through. This is not a problem in open source where we’ve had a warning for a long time.I propose we add this warning now, and let it live for a few days. Then look at the top callsites, and how many there are (and if they are benign or if calling
toString
could cause issues).