Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

[JS] String in default value of parameter throws off arrow function check #5934

Closed

Description

@j-f1

The parameters in this arrow function are not recognized as parameters:

(foo, bar = 'string') => [foo, bar];

However, if you replace the string default with a number or variable, they are properly recognized and highlighted as parameters:

(foo, bar = string) => [foo, bar];
(foo, bar = 42) => [foo, bar];

Tested in Safari 11.1.2 (12605.3.8.1), Chrome 75.0.3770.100, and Firefox 61.0 on macOS 10.12.6 (16G1510) on the latest version (using the demo at https://codemirror.net).

This is kind of the opposite of #2993.

Activity

  1. added a commit that references this issue on Jan 6, 2020
    1479829
  2. added a commit that references this issue on Jan 21, 2020
    2e3f6d4
  3. added a commit that references this issue on Sep 5, 2024
    4c30e11
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