Fix function declaration in if statement (#6963)

Firefox doesn't like these and throws.
(cherry picked from commit 3c3c30a19a)
This commit is contained in:
Ben Alpert
2016-06-04 13:37:57 -07:00
committed by Paul O’Shannessy
parent 6562466c9e
commit 6080ab547d
3 changed files with 7 additions and 6 deletions

View File

@@ -30,6 +30,7 @@ module.exports = {
'indent': [ERROR, 2, {SwitchCase: 1}],
'jsx-quotes': [ERROR, 'prefer-double'],
'no-bitwise': OFF,
'no-inner-declarations': [ERROR, 'functions'],
'no-multi-spaces': ERROR,
'no-restricted-syntax': [ERROR, 'WithStatement'],
'no-shadow': ERROR,

View File

@@ -112,7 +112,7 @@ function print(outerComponent) {
var values = keys.map((childKey) => renderedChildren[childKey]);
if (keys.length) {
function dump(children) {
var dump = function(children) {
if (typeof children === 'boolean' || children == null) {
return '' + children;
}
@@ -130,7 +130,7 @@ function print(outerComponent) {
debugger;
throw new Error('hmm');
}
}
};
markup += '\n';
var children = element.props.children;

View File

@@ -210,7 +210,7 @@ ReactElement.createElement = function(type, config, children) {
type;
// Create dummy `key` and `ref` property to `props` to warn users against its use
function warnAboutAccessingKey() {
var warnAboutAccessingKey = function() {
if (!specialPropKeyWarningShown) {
specialPropKeyWarningShown = true;
warning(
@@ -223,10 +223,10 @@ ReactElement.createElement = function(type, config, children) {
);
}
return undefined;
}
};
warnAboutAccessingKey.isReactWarning = true;
function warnAboutAccessingRef() {
var warnAboutAccessingRef = function() {
if (!specialPropRefWarningShown) {
specialPropRefWarningShown = true;
warning(
@@ -239,7 +239,7 @@ ReactElement.createElement = function(type, config, children) {
);
}
return undefined;
}
};
warnAboutAccessingRef.isReactWarning = true;
if (typeof props.$$typeof === 'undefined' ||