Skip to content

javascript highlighting breaks when using instanceof with equality, bitwise or arithmetic operators #814

Closed

Description

@pushkine
class A{}
class B{}

const a = new A()
const b = new B()

a instanceof A !== b instanceof B
a instanceof A > b instanceof B
a instanceof A & b instanceof B

Code_2020-03-28_12-29-38

1.43.2

Activity

  1. changed the title [-]javascript highlighting breaks when using `instanceof` with equality, bitwise and arithmetic operators[/-] [+]javascript highlighting breaks when using `instanceof` with equality, bitwise or arithmetic operators[/+] on Mar 28, 2020
  2. nrayburn-tech commented on Mar 28, 2020

    @nrayburn-tech

    It seems that wrapping the comparison values in () fixes the highlighting. (Not a long term solution, but if you wanted it fixed for now.)

    (a instanceof A) !== (b instanceof B)
    (a instanceof A) > (b instanceof B)
    (a instanceof A) & (b instanceof B)
    

    Screen Shot 2020-03-28 at 10 30 35 AM

  3. pushkine commented on Mar 28, 2020

    @pushkine
    Author

    Not a long term solution, but if you wanted it fixed for now.

    you cannot use a formatter with that, you'd need a double negation to keep the parentheses

  4. removed their assignment
    on Mar 31, 2020
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

      Issue actions