All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.javascript.rules.javascript.S4326.html Maven / Gradle / Ivy

There is a newer version: 10.17.0.28100
Show newest version

Why is this an issue?

An async function always wraps the return value in a Promise. Using return await is not required and comes at an extra performance cost. However, you might wish to keep it as it preserves the function call in the stack trace in case an error is thrown asynchronously.

Noncompliant code example

async function foo() {
  // ...
}

async function bar() {
  // ...
  return await foo(); // Noncompliant
}

Compliant solution

async function foo() {
  // ...
}

async function bar() {
  // ...
  return foo();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy