Skip to content

Fix TestUtils crash with NODE_ENV=production#7246

Merged
gaearon merged 1 commit intofacebook:masterfrom
gaearon:fix-testutils-crash
Jul 14, 2016
Merged

Fix TestUtils crash with NODE_ENV=production#7246
gaearon merged 1 commit intofacebook:masterfrom
gaearon:fix-testutils-crash

Conversation

@gaearon
Copy link
Collaborator

@gaearon gaearon commented Jul 11, 2016

I caused it with #7189.

We generally don’t recommend running TestUtils in production environment but this is technically a regression.

Fixes #7231.

I caused it with #7189.
We generally don’t recommend running TestUtils in production environment but this is technically a regression.

Fixes #7231.
if (__DEV__) {
this._debugID = nextDebugID++;
var displayName = element.type.displayName || element.type.name || 'Unknown';
ReactInstrumentation.debugTool.onSetDisplayName(this._debugID, displayName);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked for it again, and this is the only unguarded debugTool call in the codebase. I missed it the last time because I didn’t realize TestUtils could be run in production mode.

@zpao
Copy link
Member

zpao commented Jul 13, 2016

👍

@gaearon gaearon merged commit 27d7592 into facebook:master Jul 14, 2016
@EvHaus
Copy link

EvHaus commented Jul 20, 2016

Any chance we might see this in a 15.2.2 hot fix release?

@zpao zpao modified the milestones: 15.3.0-test, 15-next, 15.3.0 Jul 21, 2016
zpao pushed a commit that referenced this pull request Jul 22, 2016
I caused it with #7189.
We generally don’t recommend running TestUtils in production environment but this is technically a regression.

Fixes #7231.
(cherry picked from commit 27d7592)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants