Closed Bug 1751085 Opened 3 years ago Closed 3 years ago

PathUtils: Support detecting absolute paths

Categories

(Toolkit Graveyard :: OS.File, task, P1)

Tracking

(firefox98 fixed)

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: beth, Assigned: beth)

References

Details

Attachments

(1 file)

PathUtils needs support for determing if a path is absolute or not. Existing code like:

OS.Path.join(p1, p2)

will return p2 if both p1 and p2 are absolute paths. I don't think we should support this pattern explicitly, and instead should opt for:

PathUtils.isAbsolute(p2) ? p2 : PathUtils.joinRelative(p1, p2);

favouring explicitness over implicitness. It also makes PathUtils behave closer to nsIFile, which is what is implemented atop of.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: