Closed Bug 1334250 Opened 8 years ago Closed 8 years ago

Avoid more removeEventListener calls when {once: true} can be used instead

Categories

(Firefox :: General, defect)

53 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 54
Tracking Status
firefox54 --- fixed

People

(Reporter: florian, Assigned: florian)

References

Details

Attachments

(3 files)

Attached file xpcshell script
The script used in bug 1331599 missed cases where the event listener was added and removed using a variable for the event name.
This includes tweaks to the eslint rule, and changes that couldn't be handled by the script due to the capture value being in a variable.
Attachment #8830892 - Flags: review?(jaws)
Assignee: nobody → florian
Status: NEW → ASSIGNED
Attachment #8830893 - Flags: review?(jaws)
Attachment #8830892 - Flags: review?(jaws) → review+
Comment on attachment 8830893 [details] [diff] [review] script-generated patch Review of attachment 8830893 [details] [diff] [review]: ----------------------------------------------------------------- r=me with the below code removed and the function name removed as well since it is no longer necessary. ::: b2g/components/ContentRequestHelper.jsm @@ +39,5 @@ > if (!msg || !msg.id || msg.id != id) { > deferred.reject("InternalErrorWrongContentEvent " + > JSON.stringify(msg)); > SystemAppProxy.removeEventListener(aContentEventName, > onContentEvent); This is duplicate/unnecessary code?
Attachment #8830893 - Flags: review?(jaws) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/b838ee5b00577a898bf66a3958736e0727c8b796 Bug 1334250 - adapt the no-useless-removeEventListener rule to handle the listener being added and removed with the same variable + some hand fixes, r=jaws. https://hg.mozilla.org/integration/mozilla-inbound/rev/87fde7e63c1a0a7d808e2f178191f3187057c4e7 Bug 1334250 - script-generated patch to avoid removeEventListener calls when a variable is used for the event name, r=jaws.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: