Skip to content

typeof with < breaks syntax highlighting #978

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

Open
j4k0xb opened this issue Apr 17, 2023 · 0 comments · May be fixed by #1054
Open

typeof with < breaks syntax highlighting #978

j4k0xb opened this issue Apr 17, 2023 · 0 comments · May be fixed by #1054

Comments

@j4k0xb
Copy link

j4k0xb commented Apr 17, 2023

JavaScript and TypeScript Nightly version: v5.1.20230416

Code

typeof x < ''; function f() {}

For context, here's the whole code where I noticed it (common in minified js):

var gt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};

Actual behaviour: typeof with < or <= gets interpreted as the begin of a type parameter and breaks all syntax highlighting after it.
image
image

Expected behaviour: should be a relational operator.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant