Closed Bug 554307 Opened 14 years ago Closed 14 years ago

improve nsExtensionManager.js::getRandomFileName

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9.3a5

People

(Reporter: mak, Assigned: mossop)

References

Details

(Whiteboard: [rewrite])

this sucks:

var characters = "abcdefghijklmnopqrstuvwxyz0123456789";
...

please do

Math.random().toString(36).substr(2, 3);
better (handles 0 case): Math.random().toString(36).replace(/.*\./, '').substr(-3)
All this code goes away with the rewrite so no need to think about it too much.
no problem, i'm not thinking about extension manager, just that i'm fixing this code in other places, and found it here :)
Actually we need this.
Assignee: nobody → dtownsend
Blocks: 553169
Status: NEW → ASSIGNED
Whiteboard: [rewrite]
This got fixed as a part of bug 553169
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
Dave, I can't find any result for getRandomFileName. Does it mean this function has been completely removed?
(In reply to comment #6)
> Dave, I can't find any result for getRandomFileName. Does it mean this function
> has been completely removed?

I just merged the function into the main code, it is here: http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/XPIProvider.jsm#3625
Verified fixed based on last comment.
Status: RESOLVED → VERIFIED
Flags: in-testsuite-
Flags: in-litmus-
You need to log in before you can comment on or make changes to this bug.