Closed Bug 1895261 Opened 2 years ago Closed 2 years ago

webidl generates bad operator== for dictionaries that inherit from other dictionaries

Categories

(Core :: DOM: Bindings (WebIDL), task)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: bwc, Assigned: peterv)

Details

Attachments

(2 files)

Assignee: docfaraday → nobody

Peter, do you know what's going on here?

Flags: needinfo?(peterv)

We only generate a operator== for dictionaries containing strings or primitive types (see https://searchfox.org/mozilla-central/rev/ee2ad260c25310a9fbf96031de05bbc0e94394cc/dom/bindings/Codegen.py#17694-17697 and https://bugzilla.mozilla.org/show_bug.cgi?id=1249606#c1). Seems like this needs some fixes for inherited dictionaries.

This also extends the check for supported types to the types of inherited
members, and automatically generates an equality operator in the base classes if
needed. It also deletes the equality operator if a dictionary doesn't need
one but its parent does.

Assignee: nobody → peterv
Status: NEW → ASSIGNED

Byron, do you actually need these operator==s? The patch removes them, but we can add them back with the new [GenerateEqualityOperator] if needed.

Flags: needinfo?(peterv) → needinfo?(docfaraday)

I don't know that we are currently using them anywhere. Having operator== that covers all of the fields would be useful to us, but I can try that out in a separate bug.

Flags: needinfo?(docfaraday)
Type: defect → task
Pushed by pvanderbeken@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1c5b838b6f0c Only generate an equality operator for WebIDL dictionaries when they have a [GenerateEqualityOperator] extended attribute. r=farre
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: