diff --git a/devtools/client/debugger/src/client/firefox/targets.js b/devtools/client/debugger/src/client/firefox/targets.js index fd6835aed29f..70afc5ac786f 100644 --- a/devtools/client/debugger/src/client/firefox/targets.js +++ b/devtools/client/debugger/src/client/firefox/targets.js @@ -48,7 +48,7 @@ async function attachTargets(targetLists, args) { // But workers targets are still only managed by the debugger codebase // and so we have to attach their thread actor if (!threadFront) { - [, threadFront] = await targetFront.attachThread({ + threadFront = await targetFront.attachThread({ ...defaultThreadOptions(), ...args.options, }); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-chrome-debugging.js b/devtools/client/debugger/test/mochitest/browser_dbg-chrome-debugging.js index 2c931342262e..3fb56643c97b 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg-chrome-debugging.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg-chrome-debugging.js @@ -55,7 +55,7 @@ add_task(async function() { const descriptorFront = await gClient.mainRoot.getMainProcess(); const front = await descriptorFront.getTarget(); await front.attach(); - const [, threadFront] = await front.attachThread(); + const threadFront = await front.attachThread(); gThreadFront = threadFront; gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:mozilla"); diff --git a/devtools/client/framework/test/browser_target_server_compartment.js b/devtools/client/framework/test/browser_target_server_compartment.js index 8da193e8b1d6..829918ef6db0 100644 --- a/devtools/client/framework/test/browser_target_server_compartment.js +++ b/devtools/client/framework/test/browser_target_server_compartment.js @@ -39,7 +39,7 @@ async function testChromeTab() { const target = await TargetFactory.forTab(tab); await target.attach(); - const [, threadFront] = await target.attachThread(); + const threadFront = await target.attachThread(); await threadFront.resume(); const { sources } = await threadFront.getSources(); @@ -108,7 +108,7 @@ async function testMainProcess() { const target = await targetDescriptor.getTarget(); await target.attach(); - const [, threadFront] = await target.attachThread(); + const threadFront = await target.attachThread(); await threadFront.resume(); const { sources } = await threadFront.getSources(); ok( diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js index 4287a4b87534..03279409a5b7 100644 --- a/devtools/client/framework/toolbox.js +++ b/devtools/client/framework/toolbox.js @@ -729,7 +729,7 @@ Toolbox.prototype = { _attachAndResumeThread: async function(target) { const options = defaultThreadOptions(); - const [, threadFront] = await target.attachThread(options); + const threadFront = await target.attachThread(options); try { await threadFront.resume(); diff --git a/devtools/client/shared/test/browser_dbg_debugger-statement.js b/devtools/client/shared/test/browser_dbg_debugger-statement.js index 49f5fcb69915..0750310e0bb3 100644 --- a/devtools/client/shared/test/browser_dbg_debugger-statement.js +++ b/devtools/client/shared/test/browser_dbg_debugger-statement.js @@ -44,7 +44,7 @@ async function testEarlyDebuggerStatement(client, tab, targetFront) { client.off("paused", onPaused); // Now attach and resume... - const [, threadFront] = await targetFront.attachThread(); + const threadFront = await targetFront.attachThread(); await threadFront.resume(); ok(true, "Pause wasn't called before we've attached."); diff --git a/devtools/client/shared/test/helper_workers.js b/devtools/client/shared/test/helper_workers.js index f55c17954915..b7b774fe6529 100644 --- a/devtools/client/shared/test/helper_workers.js +++ b/devtools/client/shared/test/helper_workers.js @@ -265,7 +265,7 @@ this.removeTab = function removeTab(tab, win) { async function attachThreadActorForTab(tab) { const target = await TargetFactory.forTab(tab); await target.attach(); - const [, threadFront] = await target.attachThread(); + const threadFront = await target.attachThread(); await threadFront.resume(); return { client: target.client, threadFront }; } diff --git a/devtools/docs/backend/client-api.md b/devtools/docs/backend/client-api.md index f0140fce0347..896cea0e51d5 100644 --- a/devtools/docs/backend/client-api.md +++ b/devtools/docs/backend/client-api.md @@ -113,7 +113,7 @@ Once the application is attached to a tab, it can attach to its thread in order // Assuming the application is already attached to the tab, and response is the first // argument of the attachTarget callback. -client.attachThread(response.threadActor).then(function([response, threadFront]) { +client.attachThread(response.threadActor).then(function(threadFront) { if (!threadFront) { return; } @@ -178,7 +178,7 @@ function debugTab() { // Attach to the tab. targetFront.attach().then(() => { // Attach to the thread (context). - targetFront.attachThread().then(([response, threadFront]) => { + targetFront.attachThread().then((threadFront) => { // Attach listeners for thread events. threadFront.on("paused", onPause); threadFront.on("resumed", fooListener); diff --git a/devtools/server/tests/chrome/test_webextension-addon-debugging-connect.html b/devtools/server/tests/chrome/test_webextension-addon-debugging-connect.html index f1952cf0adcf..c691771ef7c0 100644 --- a/devtools/server/tests/chrome/test_webextension-addon-debugging-connect.html +++ b/devtools/server/tests/chrome/test_webextension-addon-debugging-connect.html @@ -53,7 +53,7 @@ add_task(async function test_webextension_addon_debugging_connect() { // When running in oop mode we can explicitly attach the thread without locking // the main process. - const [, threadFront] = await addonTarget.attachThread(); + const threadFront = await addonTarget.attachThread(); ok(threadFront, "Got a threadFront for the target addon"); is(threadFront.paused, true, "The addon threadActor is paused"); diff --git a/devtools/server/tests/xpcshell/head_dbg.js b/devtools/server/tests/xpcshell/head_dbg.js index 43675c3d7bb8..15be1a619aec 100644 --- a/devtools/server/tests/xpcshell/head_dbg.js +++ b/devtools/server/tests/xpcshell/head_dbg.js @@ -791,7 +791,7 @@ async function setupTestFromUrl(url) { const targetFront = findTab(tabs, "test"); await targetFront.attach(); - const [, threadFront] = await attachThread(targetFront); + const threadFront = await attachThread(targetFront); await resume(threadFront); const sourceUrl = getFileUrl(url); diff --git a/devtools/server/tests/xpcshell/test_reattach-thread.js b/devtools/server/tests/xpcshell/test_reattach-thread.js index e6abdc676fbc..f6340e47341b 100644 --- a/devtools/server/tests/xpcshell/test_reattach-thread.js +++ b/devtools/server/tests/xpcshell/test_reattach-thread.js @@ -11,7 +11,7 @@ add_task( threadFrontTest(async ({ threadFront, debuggee, client, targetFront }) => { await threadFront.detach(); Assert.equal(threadFront.state, "detached"); - const [, newThreadFront] = await targetFront.attachThread({}); + const newThreadFront = await targetFront.attachThread({}); Assert.notEqual(threadFront, newThreadFront); Assert.equal(newThreadFront.state, "paused"); Assert.equal(targetFront.threadFront, newThreadFront); diff --git a/devtools/server/tests/xpcshell/test_xpcshell_debugging.js b/devtools/server/tests/xpcshell/test_xpcshell_debugging.js index a3fdc41d65b0..b48e92ea824c 100644 --- a/devtools/server/tests/xpcshell/test_xpcshell_debugging.js +++ b/devtools/server/tests/xpcshell/test_xpcshell_debugging.js @@ -38,7 +38,7 @@ add_task(async function() { // Even though we have no tabs, getMainProcess gives us the chrome debugger. const targetDescriptor = await client.mainRoot.getMainProcess(); const front = await targetDescriptor.getTarget(); - const [, threadFront] = await front.attachThread(); + const threadFront = await front.attachThread(); // tell the thread to do the initial resume. This would cause the // xpcshell test harness to resume and load the file under test. diff --git a/devtools/shared/fronts/targets/target-mixin.js b/devtools/shared/fronts/targets/target-mixin.js index 6eb0e30a12ba..d2a5d3bf36d9 100644 --- a/devtools/shared/fronts/targets/target-mixin.js +++ b/devtools/shared/fronts/targets/target-mixin.js @@ -361,7 +361,7 @@ function TargetMixin(parentClass) { ); } this.threadFront = await this.getFront("thread"); - const result = await this.threadFront.attach(options); + await this.threadFront.attach(options); this.threadFront.on("newSource", this._onNewSource); @@ -369,7 +369,7 @@ function TargetMixin(parentClass) { // wait for the thread to be attached can resume. this._resolveOnThreadAttached(); - return [result, this.threadFront]; + return this.threadFront; } // Listener for "newSource" event fired by the thread actor diff --git a/devtools/shared/webconsole/test/chrome/common.js b/devtools/shared/webconsole/test/chrome/common.js index 9a85d2a5323f..582aa40e28b6 100644 --- a/devtools/shared/webconsole/test/chrome/common.js +++ b/devtools/shared/webconsole/test/chrome/common.js @@ -83,7 +83,7 @@ var _attachConsole = async function(listeners, attachToTab, attachToWorker) { // Attach the Target and the target thread in order to instantiate the console client. await target.attach(); - const [, threadFront] = await target.attachThread(); + const threadFront = await target.attachThread(); await threadFront.resume(); const webConsoleFront = await target.getFront("console");