Closed Bug 1851759 Opened 10 months ago Closed 10 months ago

top-level await does not handle for..in

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(firefox119 verified, firefox120 verified)

VERIFIED FIXED
119 Branch
Tracking Status
firefox119 --- verified
firefox120 --- verified

People

(Reporter: nchevobbe, Assigned: krishna.ravi732)

References

Details

Attachments

(1 file)

Steps to reproduce

  1. Open the console
  2. Evaluate the following
j = { "foo": 1, "bar": 2}
await 42
for (var k in j){
  console.log(k)
}

Expected results

foo and bar are logged to the console output

Actual results

only undefined is logged


It looks like something is wrong in the transformation we do to the input.
Here's the actual expression we send to the server:

(async () => {
  j = {
    "foo": 1,
    "bar": 2
  };
  await 42;
  return;
})();

the mapping is done in https://searchfox.org/mozilla-central/rev/a4cb813cd4026cc24b45e843222e6a08204bae47/devtools/client/debugger/src/workers/parser/mapAwaitExpression.js

Bug 1839588 would help here, but this can probably be fixed in DevTools codebase.

Severity: -- → S3
Priority: -- → P2
Assignee: nobody → krishna.ravi732
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/00a66a4ea7d3
[devtools] Fix incorrect removal of non-expr-stmt when top-level-await is present r=devtools-reviewers,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
QA Whiteboard: [qa-119b-p2]

Reproducible on a 2023-09-05 Nightly build on macOS 12.
Verified as fixed on Firefox 119.0b4(build ID: 20231002091755) and Nightly 120.0a1(build ID: 20231002221644) on macOS 12, Windows 10, Ubuntu 22.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-119b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: