Closed Bug 1506118 Opened Last year Closed Last year

Console fails to evaluate code with (non-top-level) 'await' in Browser Toolbox

Categories

(DevTools :: Console, defect, P3)

64 Branch
defect

Tracking

(firefox-esr60 unaffected, firefox63 unaffected, firefox64 verified, firefox65 verified)

VERIFIED FIXED
Firefox 65
Tracking Status
firefox-esr60 --- unaffected
firefox63 --- unaffected
firefox64 --- verified
firefox65 --- verified

People

(Reporter: Oriol, Assigned: nchevobbe)

References

Details

(Keywords: regression, testcase)

Attachments

(1 file)

Open the browser toolbox, in the console enter

    (async function() { console.log(await 1) })();

It works the first time, and you get

    Promise { <state>: "pending" }
    1

But then run the same code again. There is no result, neither the returned promise nor the logged value.

It works if I remove 'await'.

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=f2e35ed6a6928b35e085462dc4268fd86f00fdb9&tochange=21f2d2802b18cf831154d454535d27998a6c5176
Flags: needinfo?(nchevobbe)
Just tested in webconsole and browser toolbox console, and I do get the returned Promise and then `1` for each evaluation, even if I do it several times in a row.
I tested it both in Nightly and DevEdition.

Am I missing something from your STR ?
Flags: needinfo?(nchevobbe) → needinfo?(oriol-bugzilla)
(In reply to Nicolas Chevobbe from comment #1)
> Just tested in webconsole and browser toolbox console, and I do get the
> returned Promise and then `1` for each evaluation, even if I do it several
> times in a row.
> I tested it both in Nightly and DevEdition.
> 
> Am I missing something from your STR ?

I can reproduce with both Nightly and DevEdition, in Lubuntu 18.04 and Windows 10.
The browser console and the browser content toolbox work well. It's just the browser toolbox (or also an add-on toolbox in about:debugging).
Flags: needinfo?(oriol-bugzilla)
ah, reproduced. I think it appears when *not* opening the debugger panel
That's right, opening the debugger panel solves the problem.
Can we get an assignee on this?
Flags: needinfo?(nchevobbe)
sure
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Flags: needinfo?(nchevobbe)
Summary: Console fails to evaluate code with 'await' (non-top-level) → Console fails to evaluate code with (non-top-level) 'await' in Browser Toolbox
Priority: -- → P3
As we were using the browserWindow to start the
parser worker, this was causing an exception
when evaluation from the browser toolbox.
Using chromUtilsWindow fixes the issue.

There is no tests yet as I'm not sure there's
an easy way to test things in the browser toolbox.
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1bd7fb2e6258
Use chromeUtilsWindow to start the parser worker; r=Honza.
https://hg.mozilla.org/mozilla-central/rev/1bd7fb2e6258
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Firefox 65
Please nominate this for Beta approval when you get a chance.
Flags: qe-verify+
Flags: needinfo?(nchevobbe)
Verified - Fixed on the latest Nightly 65.0a1 (2018-11-20) (64-bit) on Windows 10 x64, Ubuntu 16.04 and Mac OS 10.13.
Comment on attachment 9025579 [details]
Bug 1506118 - Use chromeUtilsWindow to start the parser worker; r=Honza.

[Beta/Release Uplift Approval Request]

Feature/Bug causing the regression: None

User impact if declined: In the Browser Toolbox, the user would only have a result for the first expression containing "await" in it. All the following evaluations would show no results.

Is this code covered by automated tests?: No

Has the fix been verified in Nightly?: Yes

Needs manual test from QE?: Yes

If yes, steps to reproduce: 1. Open the Browser Toolbox
2. Go the the console panel
3. Evaluate `(async function() { console.log(await 1) })();`
4. You should see `1` printed
5. Evaluate `(async function() { console.log(await 1) })();` again
6. You should see `1` printed, again

List of other uplifts needed: None

Risk to taking this patch: Low

Why is the change risky/not risky? (and alternatives if risky): This is a devtools only, browser toolbox only change, which only impact people working on Firefox.

String changes made/needed:
Flags: needinfo?(nchevobbe)
Attachment #9025579 - Flags: approval-mozilla-beta?
Comment on attachment 9025579 [details]
Bug 1506118 - Use chromeUtilsWindow to start the parser worker; r=Honza.

simple fix for browser toolbox, approved for 64.0b12
Attachment #9025579 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Managed to reproduce with 65.0a1( 20181109220759).
Verified with 64.0b11 on Win10x64, macOS10.13, Ubuntu16.04.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.