Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Object.is implementation when compare values inside React.PropTypes.oneOf #6132

Merged

Conversation

Projects
None yet
5 participants
@chicoxyzzy
Copy link
Contributor

commented Feb 26, 2016

implementation of #6131

return x !== 0 || 1 / x === 1 / y;
} else {
// Step 6.a: NaN == NaN
return x !== x && y !== y;

This comment has been minimized.

Copy link
@chicoxyzzy

chicoxyzzy Feb 26, 2016

Author Contributor

eslint emits warnings here

  99:12  warning  Comparing to itself is potentially pointless  no-self-compare
  99:23  warning  Comparing to itself is potentially pointless  no-self-compare

✖ 2 problems (0 errors, 2 warnings)

what should I do here?

This comment has been minimized.

Copy link
@zpao

zpao Feb 28, 2016

Member

Just disable that warning for the file.

This comment has been minimized.

Copy link
@chicoxyzzy

chicoxyzzy Feb 29, 2016

Author Contributor

done and rebased

* inlined Object.is polyfill to avoid requiring consumers ship their own
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
function is(x, y) {

This comment has been minimized.

Copy link
@syranide

This comment has been minimized.

Copy link
@zpao

zpao Feb 28, 2016

Member

Nah, just going to do this for now.

@chicoxyzzy chicoxyzzy force-pushed the chicoxyzzy:use_object_is_in_oneof_validate_method branch from 8229a5e to 03925f4 Feb 29, 2016

@facebook-github-bot

This comment has been minimized.

Copy link

commented Feb 29, 2016

@chicoxyzzy updated the pull request.

* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
/*eslint-disable no-self-compare*/
function is(x, y) {

This comment has been minimized.

Copy link
@jimfb

jimfb Feb 29, 2016

Contributor

This seems like a weird place to define a polyfill. Seems like we should do something more analogous to https://github.com/facebook/react/blob/master/src/shared/stubs/Object.assign.js

This comment has been minimized.

Copy link
@zpao

zpao Feb 29, 2016

Member

This is intentional and requested by me due to conversations had with @sebmarkbage a couple months ago, don't worry about it. We can deal with figuring out the polyfill story later.

@zpao

This comment has been minimized.

Copy link
Member

commented Feb 29, 2016

Thanks!

zpao added a commit that referenced this pull request Feb 29, 2016

Merge pull request #6132 from chicoxyzzy/use_object_is_in_oneof_valid…
…ate_method

Using Object.is implementation when compare values inside React.PropTypes.oneOf

@zpao zpao merged commit 730e5ac into facebook:master Feb 29, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@chicoxyzzy chicoxyzzy deleted the chicoxyzzy:use_object_is_in_oneof_validate_method branch Mar 1, 2016

@renovate renovate bot referenced this pull request Feb 2, 2018

Open

Update dependency react to v0.14.9 #29

0 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.