summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-11-22 12:47:50 -0800
committerRich Trott <rtrott@gmail.com>2017-11-30 23:24:44 -0800
commit929f343bb3c2f7847711fed7ddb79ec5cf97f9b7 (patch)
tree03fef5f28fdcee79347fc968beb85c95e46cf08f /test
parent7850112c339ad1eac437bb22d562ea00a98be04a (diff)
downloadandroid-node-v8-929f343bb3c2f7847711fed7ddb79ec5cf97f9b7.tar.gz
android-node-v8-929f343bb3c2f7847711fed7ddb79ec5cf97f9b7.tar.bz2
android-node-v8-929f343bb3c2f7847711fed7ddb79ec5cf97f9b7.zip
doc,test: remove unnecessary await with return instances
Remove unnecessary `await` in combination with `return` in preparation for enabling lint rule. PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test')
-rw-r--r--test/common/inspector-helper.js2
-rw-r--r--test/parallel/test-util-callbackify.js10
2 files changed, 6 insertions, 6 deletions
diff --git a/test/common/inspector-helper.js b/test/common/inspector-helper.js
index 81aa046bf3..454eef4c5e 100644
--- a/test/common/inspector-helper.js
+++ b/test/common/inspector-helper.js
@@ -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() {
diff --git a/test/parallel/test-util-callbackify.js b/test/parallel/test-util-callbackify.js
index 0999fc4fd3..84b439e43f 100644
--- a/test/parallel/test-util-callbackify.js
+++ b/test/parallel/test-util-callbackify.js
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -241,7 +241,7 @@ const values = [
{
async function asyncFn() {
- return await Promise.resolve(42);
+ return 42;
}
const cb = callbackify(asyncFn);