Skip to content

negate async function result will break in safari 11 #4138

@KnisterPeter

Description

@KnisterPeter

Negating the return value of an async function call in an if statement breaks in safari.

Prettier 1.11.1
Playground link

Input:

async () => {
  if (!await test()) {
    // some
  }
  // else
};

Output:

async () => {
  if (!await test()) {
    // some
  }
  // else
};

Expected behavior:

Output:

async () => {
  if (!(await test())) {
    // some
  }
  // else
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:javascriptIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions