Add destructors to pooled classes in ReactChildren#4720
Add destructors to pooled classes in ReactChildren#4720sophiebits merged 1 commit intofacebook:masterfrom
Conversation
|
Note to self: a couple internal users of this will need to be fixed. |
|
Note to @spicyj: we should add a test that makes sure we expect an error when a destructor doesn't exist |
|
I mean, I don't care that much! |
|
I am finding hard to imagine a scenario in which adding a test for this would really help. We already have a test making sure the destructor is called if present; no one will accidentally reintroduce an |
|
The scenario is that (edit) somebody who isn't one of us comes along, gets an error in their class which doesn't have a destructor, and decides that PooledClass must need a null check, then gets it reviewed by somebody who didn't see this discussion. They ran the tests and nothing failed so assumed it's an ok change to make since it didn't break expectations. At least if they delete a test they have to acknowledge that they are changing expected behavior. |
|
But who would add a null check? All pooled classes store some sort of data and thus need a destructor so it wouldn't make sense to make it optional again. But okay, I'll add a test. |
|
^^ |
|
👍 |
And make destructors mandatory so we're less likely to forget again.
Add destructors to pooled classes in ReactChildren
They are no longer optional since facebook#4720
They are no longer optional since #4720
And make destructors mandatory so we're less likely to forget again.