Skip to content

Incorrect formating of ||= logical or assignment  #73

Closed
@juanpablius

Description

@juanpablius

When running clang format on JavaScript sentences:

let myVar;
myVar ||= 2;

clang-format transforms it to

let myVar;
myVar || = 2;

It seems it doesn't understand the logical or assignemt from js
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR_assignment

Activity

mprobst

mprobst commented on Dec 3, 2021

@mprobst
Contributor

This was fixed in LLVM change 16212b8b3e4f, about a year ago.

I believe this change should be included in recent releases of clang-format - maybe you're on an old version?

mprobst

mprobst commented on Dec 3, 2021

@mprobst
Contributor

Please reopen if you can repro with the latest version.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mprobst@juanpablius

        Issue actions

          Incorrect formating of ||= logical or assignment · Issue #73 · angular/clang-format