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

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

Closed
pushkine opened this issue Mar 28, 2020 · 2 comments

Comments

@pushkine
Copy link

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

@pushkine pushkine 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 Mar 28, 2020
@nrayburn-tech
Copy link

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

@pushkine
Copy link
Author

pushkine commented Mar 28, 2020

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

@mjbvz mjbvz self-assigned this Mar 28, 2020
@mjbvz mjbvz transferred this issue from microsoft/vscode Mar 31, 2020
@mjbvz mjbvz removed their assignment Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants