28 lines
396 B
Plaintext
28 lines
396 B
Plaintext
An ``++async++`` function always wraps the return value in a ``++Promise++``. Using ``++return await++`` is therefore redundant.
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
async function foo() {
|
|
// ...
|
|
}
|
|
|
|
async function bar() {
|
|
// ...
|
|
return await foo(); // Noncompliant
|
|
}
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
async function foo() {
|
|
// ...
|
|
}
|
|
|
|
async function bar() {
|
|
// ...
|
|
return foo();
|
|
}
|
|
----
|