Closed Bug 1693068 Opened 4 years ago Closed 4 years ago

CustomElementRegistry::WhenDefined creates a Promise, which might not be used

Categories

(Core :: DOM: Core & HTML, task)

task

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: sg, Assigned: sg)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

CustomElementRegistry::WhenDefined creates a Promise at the very beginning, but it might not be used: When the function reaches the final return statement, and there already is an entry in mWhenDefinedPromiseMap, it is just discarded. This could be refactored so that a Promise is only created in the cases where it's needed.

Regressed by: 1275839
Has Regression Range: --- → yes
Keywords: regression
Assignee: nobody → sgiesecke
Status: NEW → ASSIGNED

The Bugbug bot thinks this bug is a defect, but please change it back in case of error.

Type: task → defect
Type: defect → task
Attachment #9203456 - Attachment description: Bug 1693068 - Use function to lazily create a Promise when needed in CustomElementRegistry::WhenDefined. r=emilio → Bug 1693068 - Use function to lazily create a Promise when needed in CustomElementRegistry::WhenDefined. r=#xpcom-reviewers
Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/85548fff7e00 Use function to lazily create a Promise when needed in CustomElementRegistry::WhenDefined. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: