Closed Bug 1599445 Opened 5 years ago Closed 5 years ago

Investigate refactoring CCRunnerFired to make it easier to follow

Categories

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

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

I find the CCRunnerFired function pretty hard to follow. Mostly this is because control doesn't move linearly between the branches of the main if-statement but jumps between them on subsequent calls. And also it can recursively call itself which is confusing in itself.

I'd like to refactor this to make it easier to follow.

This makes the function into a state machine implemented with a switch statement and gets rid of the recursive call. This results in a little duplication of logic but hopefully it is easier to understand overall. What do you think?

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f8533b22dc9b Refactor CCRunnerFired function by writing it as a state machine r=mccr8
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Regressions: 1599987
Regressions: 1600565
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: