From a6c4a7cc8e79eff59b2264d00d74230a9e3ed8b2 Mon Sep 17 00:00:00 2001 From: Meek Denzo Date: Fri, 27 May 2022 19:28:39 -0500 Subject: [PATCH 1/5] test: convert then to async/await --- src/inspector/main_thread_interface.cc | 6 ++++++ test/parallel/test-debugger-address.js | 25 +++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc index 0cf75a37146729..737140d04a809f 100644 --- a/src/inspector/main_thread_interface.cc +++ b/src/inspector/main_thread_interface.cc @@ -288,6 +288,12 @@ Deletable* MainThreadInterface::GetObjectIfExists(int id) { return iterator->second.get(); } + +// v8::Isolate *isolate = v8::Isolate::TryGetCurrent(); +// CHECK_NOT_NULL(isolate); +// uint16_t *buffer; +// v8::String::NewFromUtf8(isolate, message.data())->Write(buffer); + std::unique_ptr Utf8ToStringView(const std::string& message) { icu::UnicodeString utf16 = icu::UnicodeString::fromUTF8( icu::StringPiece(message.data(), message.length())); diff --git a/test/parallel/test-debugger-address.js b/test/parallel/test-debugger-address.js index bffc28ac916e8d..dcc5ff2772ff5b 100644 --- a/test/parallel/test-debugger-address.js +++ b/test/parallel/test-debugger-address.js @@ -53,21 +53,22 @@ function launchTarget(...args) { assert.ifError(error); } - return launchTarget('--inspect=0', script) - .then(({ childProc, host, port }) => { + (async () => { + try { + const { childProc, host, port } = await launchTarget('--inspect=0', script); target = childProc; cli = startCLI([`${host || '127.0.0.1'}:${port}`]); - return cli.waitForPrompt(); - }) - .then(() => cli.command('sb("alive.js", 3)')) - .then(() => cli.waitFor(/break/)) - .then(() => cli.waitForPrompt()) - .then(() => { + await cli.waitForPrompt(); + await cli.command('sb("alive.js", 3)'); + await cli.waitFor(/break/); + await cli.waitForPrompt(); assert.match( cli.output, /> 3 {3}\+\+x;/, - 'marks the 3rd line'); - }) - .then(() => cleanup()) - .then(null, cleanup); + 'marks the 3rd line' + ); + } finally { + cleanup(); + } + })(); } From 6d6f4584e0e91aba38cf9db6c451b7b4e858fe04 Mon Sep 17 00:00:00 2001 From: Meek Denzo Date: Fri, 27 May 2022 20:48:59 -0500 Subject: [PATCH 2/5] test: fix unrelated changes --- src/inspector/main_thread_interface.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc index 737140d04a809f..0cf75a37146729 100644 --- a/src/inspector/main_thread_interface.cc +++ b/src/inspector/main_thread_interface.cc @@ -288,12 +288,6 @@ Deletable* MainThreadInterface::GetObjectIfExists(int id) { return iterator->second.get(); } - -// v8::Isolate *isolate = v8::Isolate::TryGetCurrent(); -// CHECK_NOT_NULL(isolate); -// uint16_t *buffer; -// v8::String::NewFromUtf8(isolate, message.data())->Write(buffer); - std::unique_ptr Utf8ToStringView(const std::string& message) { icu::UnicodeString utf16 = icu::UnicodeString::fromUTF8( icu::StringPiece(message.data(), message.length())); From c62c79de6c07a0f484bcfce0817d39eed6274bfc Mon Sep 17 00:00:00 2001 From: Meek Denzo Date: Fri, 27 May 2022 21:48:46 -0500 Subject: [PATCH 3/5] test: modify then to async/await --- test/parallel/test-debugger-address.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-debugger-address.js b/test/parallel/test-debugger-address.js index dcc5ff2772ff5b..e8cfd428ebcb05 100644 --- a/test/parallel/test-debugger-address.js +++ b/test/parallel/test-debugger-address.js @@ -58,7 +58,7 @@ function launchTarget(...args) { const { childProc, host, port } = await launchTarget('--inspect=0', script); target = childProc; cli = startCLI([`${host || '127.0.0.1'}:${port}`]); - await cli.waitForPrompt(); + await cli.waitForPrompt(); await cli.command('sb("alive.js", 3)'); await cli.waitFor(/break/); await cli.waitForPrompt(); @@ -70,5 +70,5 @@ function launchTarget(...args) { } finally { cleanup(); } - })(); + })().then(common.mustCall()); } From 14c20f508c2002b5cbf716f32103460b9074de32 Mon Sep 17 00:00:00 2001 From: Meek Denzo Date: Tue, 31 May 2022 23:07:19 -0500 Subject: [PATCH 4/5] test: confirm rebase with dummy comment --- test/parallel/test-debugger-address.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/parallel/test-debugger-address.js b/test/parallel/test-debugger-address.js index e8cfd428ebcb05..6d47c2cf1e6483 100644 --- a/test/parallel/test-debugger-address.js +++ b/test/parallel/test-debugger-address.js @@ -53,6 +53,7 @@ function launchTarget(...args) { assert.ifError(error); } + // test comment (async () => { try { const { childProc, host, port } = await launchTarget('--inspect=0', script); From b5de072634196485b301968e3212b35054d8a8da Mon Sep 17 00:00:00 2001 From: Meek Denzo Date: Tue, 31 May 2022 23:29:57 -0500 Subject: [PATCH 5/5] test: remove dummy comment --- test/parallel/test-debugger-address.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/parallel/test-debugger-address.js b/test/parallel/test-debugger-address.js index 6d47c2cf1e6483..e8cfd428ebcb05 100644 --- a/test/parallel/test-debugger-address.js +++ b/test/parallel/test-debugger-address.js @@ -53,7 +53,6 @@ function launchTarget(...args) { assert.ifError(error); } - // test comment (async () => { try { const { childProc, host, port } = await launchTarget('--inspect=0', script);