Skip to content

Commit

Permalink
Fix function declaration in if statement (facebook#6963)
Browse files Browse the repository at this point in the history
Firefox doesn't like these and throws.
  • Loading branch information
sophiebits committed Jun 4, 2016
1 parent 96994c2 commit 3c3c30a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions scripts/bench/extract-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -130,7 +130,7 @@ function print(outerComponent) {
debugger;
throw new Error('hmm');
}
}
};

markup += '\n';
var children = element.props.children;
Expand Down
8 changes: 4 additions & 4 deletions src/isomorphic/classic/element/ReactElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -239,7 +239,7 @@ ReactElement.createElement = function(type, config, children) {
);
}
return undefined;
}
};
warnAboutAccessingRef.isReactWarning = true;

if (typeof props.$$typeof === 'undefined' ||
Expand Down

0 comments on commit 3c3c30a

Please sign in to comment.