FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

`typeof` with `<` breaks syntax highlighting · Issue #978 · microsoft/TypeScript-TmLanguage · GitHub

typeof with < breaks syntax highlighting #978

Description

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.

Expected behaviour: should be a relational operator.

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


    Back | FazBrowse Home | New Git URL