Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/renderers/dom/client/syntheticEvents/SyntheticEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,21 @@ Object.assign(SyntheticEvent.prototype, {
this[shouldBeReleasedProperties[i]] = null;
}
if (__DEV__) {
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));
Object.defineProperty(
this,
'nativeEvent',
getPooledWarningPropertyDefinition('nativeEvent', null)
);
Object.defineProperty(
this,
'preventDefault',
getPooledWarningPropertyDefinition('preventDefault', emptyFunction)
);
Object.defineProperty(
this,
'stopPropagation',
getPooledWarningPropertyDefinition('stopPropagation', emptyFunction)
);
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ describe('ReactDOMComponent', function() {
});

ReactTestUtils.renderIntoDocument(<Component />);
expect(console.error.calls.length).toBe(0);
expect(console.error.calls.count()).toBe(0);
});

it('should warn nicely about NaN in style', function() {
Expand Down
4 changes: 3 additions & 1 deletion src/renderers/native/ReactNativeAttributePayload.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ function diffProperties(
// default: fallthrough case when nested properties are defined
removedKeys = null;
removedKeyCount = 0;
// $FlowFixMe - We think that attributeConfig is not CustomAttributeConfiguration at this point so we assume it must be AttributeConfiguration.
// $FlowFixMe - We think that attributeConfig is not
// CustomAttributeConfiguration at this point so we assume
// it must be AttributeConfiguration.
updatePayload = diffNestedProperty(
updatePayload,
prevProp,
Expand Down
7 changes: 6 additions & 1 deletion src/renderers/shared/fiber/isomorphic/ReactCoroutine.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ export type ReactYield = {
continuation: mixed
};

exports.createCoroutine = function<T>(children : mixed, handler : CoroutineHandler<T>, props : T, key : ?string = null) : ReactCoroutine {
exports.createCoroutine = function<T>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

We generally wrap long arg lists like this, can you tweak it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, no problem. To avoid an extra commit, will it work for me to amend the commit and force push to my fork? Or I can make a new pull request. What do you prefer?

Copy link
Contributor

Choose a reason for hiding this comment

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

GitHub supports "squash and merge" now so feel free to add a new commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adjusted line breaks to match reviewer feedback.

children : mixed,
handler : CoroutineHandler<T>,
props : T,
key : ?string = null
) : ReactCoroutine {
var coroutine = {
// This tag allow us to uniquely identify this as a React Coroutine
$$typeof: REACT_COROUTINE_TYPE,
Expand Down