Skip to content

operator || #40699

Description

@essential-existence

position = bufferOrOptions.position || null;

If the value is "0", it is converted to "null", which causes the low-level read position of the file to be taken into account. I suggest:
position = bufferOrOptions.position ?? null;.

Operator || - this evil!

Activity

  1. added
    fsIssues and PRs related to file-system APIs and the fs module.
    on Nov 2, 2021
  2. added
    invalidIssues and PRs that are invalid.
    on Nov 2, 2021
  3. reopened this on Nov 2, 2021
  4. removed
    invalidIssues and PRs that are invalid.
    on Nov 2, 2021
  5. mihilmy commented on Nov 3, 2021

    @mihilmy
    Contributor

    Duplicate of #40715
    I have some more details with repros in #40715

  6. essential-existence commented on Nov 6, 2021

    @essential-existence
    Author

    Duplicate of #40715 I have some more details with repros in #40715

    I am glad that you soon noticed this error too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions