Closed Bug 1623383 Opened 5 years ago Closed 5 years ago

Cleanup URIFixup.jsm

Categories

(Core :: DOM: Navigation, task, P3)

task
Points:
2

Tracking

()

RESOLVED FIXED
mozilla78
Iteration:
78.1 - May 4 - May 17
Tracking Status
firefox78 --- fixed

People

(Reporter: mak, Assigned: mak)

References

Details

Attachments

(2 files)

The initial implementation of URIFixup.jsm from bug 1496578 is in large chunks a direct port of the cpp code, it contains some string loops and inefficiencies that were not modified to avoid introducing too many risks of regressions at once.

Once that lands, we can move on with cleaning up the code to use proper js.

A few things that come to my mind:

  1. strings walking, most of it can be replaced with regex or other string functions
  2. one of the loops uses a custom NOT_FOUND value because the cpp code was overflowing kNotFound (-1) into an unsigned integer and all the code was based on that

Another thing to cleanup would be to check if the following else can be merged into the previous if (... || !possiblyHostPortRegex.test(uriString))

else {
        // If the given URL has a user:password we can't just pass it to the
        // external protocol handler; we'll try using it with http instead
        // later
        info.fixedURI = null;
      }
Assignee: nobody → mak
Status: NEW → ASSIGNED
Iteration: --- → 78.1 - May 4 - May 17
Points: --- → 2
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: