mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Fix function declaration in if statement (#6963)
Firefox doesn't like these and throws.
(cherry picked from commit 3c3c30a19a)
This commit is contained in:
committed by
Paul O’Shannessy
parent
6562466c9e
commit
6080ab547d
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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' ||
|
||||
|
||||
Reference in New Issue
Block a user