Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc,test: remove unnecessary await with return instances
Remove unnecessary `await` in combination with `return` in preparation
for enabling lint rule.
  • Loading branch information
Trott committed Nov 29, 2017
commit 58f7f4030f4b506f4b9dfb9c97d3ff73e5d81f9c
2 changes: 1 addition & 1 deletion doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ For example:
const util = require('util');

async function fn() {
return await Promise.resolve('hello world');
return 'hello world';
}
const callbackFunction = util.callbackify(fn);

Expand Down
2 changes: 1 addition & 1 deletion test/common/inspector-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ class NodeInstance {
console.log('[test]', 'Connecting to a child Node process');
const response = await this.httpGet(null, '/json/list');
const url = response[0]['webSocketDebuggerUrl'];
return await this.wsHandshake(url);
return this.wsHandshake(url);
}

expectShutdown() {
Expand Down
10 changes: 5 additions & 5 deletions test/parallel/test-util-callbackify.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const values = [
for (const value of values) {
// Test and `async function`
async function asyncFn() {
return await Promise.resolve(value);
return value;
}

const cbAsyncFn = callbackify(asyncFn);
Expand Down Expand Up @@ -70,7 +70,7 @@ const values = [
for (const value of values) {
// Test an `async function`
async function asyncFn() {
return await Promise.reject(value);
return Promise.reject(value);
}

const cbAsyncFn = callbackify(asyncFn);
Expand Down Expand Up @@ -142,7 +142,7 @@ const values = [
for (const value of values) {
async function asyncFn(arg) {
assert.strictEqual(arg, value);
return await Promise.resolve(arg);
return arg;
}

const cbAsyncFn = callbackify(asyncFn);
Expand Down Expand Up @@ -183,7 +183,7 @@ const values = [
const iAmThat = {
async fn(arg) {
assert.strictEqual(this, iAmThat);
return await Promise.resolve(arg);
return arg;
},
};
iAmThat.cbFn = callbackify(iAmThat.fn);
Expand Down Expand Up @@ -241,7 +241,7 @@ const values = [

{
async function asyncFn() {
return await Promise.resolve(42);
return 42;
}

const cb = callbackify(asyncFn);
Expand Down