Merge pull request #5965 from karczk/issue-5957

Fix for #5957: Bug on resolving default props (HTMLAllCollection)
This commit is contained in:
Jim
2016-02-03 14:39:11 -08:00
6 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ function ReactLink(value, requestChange) {
*/
function createLinkTypeChecker(linkType) {
var shapes = {
value: typeof linkType === 'undefined' ?
value: linkType === undefined ?
React.PropTypes.any.isRequired :
linkType.isRequired,
requestChange: React.PropTypes.func.isRequired,
+1 -1
View File
@@ -777,7 +777,7 @@ var ReactClass = {
var initialState = this.getInitialState ? this.getInitialState() : null;
if (__DEV__) {
// We allow auto-mocks to proceed as if they're returning null.
if (typeof initialState === 'undefined' &&
if (initialState === undefined &&
this.getInitialState._isMockFunction) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.
@@ -153,7 +153,7 @@ ReactElement.createElement = function(type, config, children) {
if (type && type.defaultProps) {
var defaultProps = type.defaultProps;
for (propName in defaultProps) {
if (typeof props[propName] === 'undefined') {
if (props[propName] === undefined) {
props[propName] = defaultProps[propName];
}
}
@@ -138,7 +138,7 @@ function setIEOffsets(node, offsets) {
var range = document.selection.createRange().duplicate();
var start, end;
if (typeof offsets.end === 'undefined') {
if (offsets.end === undefined) {
start = offsets.start;
end = start;
} else if (offsets.start > offsets.end) {
@@ -176,7 +176,7 @@ function setModernOffsets(node, offsets) {
var selection = window.getSelection();
var length = node[getTextContentAccessor()].length;
var start = Math.min(offsets.start, length);
var end = typeof offsets.end === 'undefined' ?
var end = offsets.end === undefined ?
start : Math.min(offsets.end, length);
// IE 11 uses modern selection, but doesn't support the extend method.
@@ -114,7 +114,7 @@ var ReactInputSelection = {
setSelection: function(input, offsets) {
var start = offsets.start;
var end = offsets.end;
if (typeof end === 'undefined') {
if (end === undefined) {
end = start;
}
@@ -188,7 +188,7 @@ var ReactCompositeComponentMixin = {
Component.displayName || Component.name || 'Component';
warning(
typeof inst.props === 'undefined' || !propsMutated,
inst.props === undefined || !propsMutated,
'%s(...): When calling super() in `%s`, make sure to pass ' +
'up the same props that your component\'s constructor was passed.',
componentName, componentName
@@ -673,7 +673,7 @@ var ReactCompositeComponentMixin = {
if (__DEV__) {
warning(
typeof shouldUpdate !== 'undefined',
shouldUpdate !== undefined,
'%s.shouldComponentUpdate(): Returned undefined instead of a ' +
'boolean value. Make sure to return true or false.',
this.getName() || 'ReactCompositeComponent'
@@ -839,7 +839,7 @@ var ReactCompositeComponentMixin = {
var renderedComponent = inst.render();
if (__DEV__) {
// We allow auto-mocks to proceed as if they're returning null.
if (typeof renderedComponent === 'undefined' &&
if (renderedComponent === undefined &&
inst.render._isMockFunction) {
// This is probably bad practice. Consider warning here and
// deprecating this convenience.