Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2af1bf5

Browse filesBrowse files
Trottgibfahn
authored andcommitted
doc,test: remove unnecessary await with return instances
Remove unnecessary `await` in combination with `return` in preparation for enabling lint rule. PR-URL: #17265 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent dbae582 commit 2af1bf5
Copy full SHA for 2af1bf5

File tree

Expand file treeCollapse file tree

3 files changed

+7
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+7
-7
lines changed
Open diff view settings
Collapse file

‎doc/api/util.md‎

Copy file name to clipboardExpand all lines: doc/api/util.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ For example:
3131
const util = require('util');
3232

3333
async function fn() {
34-
return await Promise.resolve('hello world');
34+
return 'hello world';
3535
}
3636
const callbackFunction = util.callbackify(fn);
3737

Collapse file

‎test/common/inspector-helper.js‎

Copy file name to clipboardExpand all lines: test/common/inspector-helper.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ class NodeInstance {
390390
console.log('[test]', 'Connecting to a child Node process');
391391
const response = await this.httpGet(null, '/json/list');
392392
const url = response[0]['webSocketDebuggerUrl'];
393-
return await this.wsHandshake(url);
393+
return this.wsHandshake(url);
394394
}
395395

396396
expectShutdown() {
Collapse file

‎test/parallel/test-util-callbackify.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-util-callbackify.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const values = [
2828
for (const value of values) {
2929
// Test and `async function`
3030
async function asyncFn() {
31-
return await Promise.resolve(value);
31+
return value;
3232
}
3333

3434
const cbAsyncFn = callbackify(asyncFn);
@@ -70,7 +70,7 @@ const values = [
7070
for (const value of values) {
7171
// Test an `async function`
7272
async function asyncFn() {
73-
return await Promise.reject(value);
73+
return Promise.reject(value);
7474
}
7575

7676
const cbAsyncFn = callbackify(asyncFn);
@@ -142,7 +142,7 @@ const values = [
142142
for (const value of values) {
143143
async function asyncFn(arg) {
144144
assert.strictEqual(arg, value);
145-
return await Promise.resolve(arg);
145+
return arg;
146146
}
147147

148148
const cbAsyncFn = callbackify(asyncFn);
@@ -183,7 +183,7 @@ const values = [
183183
const iAmThat = {
184184
async fn(arg) {
185185
assert.strictEqual(this, iAmThat);
186-
return await Promise.resolve(arg);
186+
return arg;
187187
},
188188
};
189189
iAmThat.cbFn = callbackify(iAmThat.fn);
@@ -241,7 +241,7 @@ const values = [
241241

242242
{
243243
async function asyncFn() {
244-
return await Promise.resolve(42);
244+
return 42;
245245
}
246246

247247
const cb = callbackify(asyncFn);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.