Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Arrow functions at the end of ternary expressions are not recognized #406

Closed
@not-an-aardvark

Description

@not-an-aardvark

Using Atom 1.9.9

Example code:

var result = condition ? something : (arg1, arg2) => new Foo(arg1, arg2);

Atom renders it like this:

Note that the arrow function body is not highlighted at all (e.g. new should be identified as a keyword).

This issue also occurs when using curly brackets for an expression body, so the following code also displays the bug:

var result = condition ? something : (arg1, arg2) => { return new Foo(arg1, arg2) };

However, it seems to be fixed if the curly brackets are followed by a newline, so the following code is highlighted correctly:

var result = condition ? something : (arg1, arg2) => {
  return new Foo(arg1, arg2)
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions