Closed Bug 532369 Opened 10 years ago Closed 2 years ago

deprecation warnings about octal literals in server.js


(Testing :: Mochitest, defect)

Not set


(Not tracked)



(Reporter: ted, Unassigned)


(Whiteboard: [leave open])

JS Component Loader: WARNING chrome://mochikit/content/server.js:168
                     octal literals and octal escape sequences are deprecated
JS Component Loader: WARNING chrome://mochikit/content/server.js:224
                     octal literals and octal escape sequences are deprecated

I guess these got deprecated in ES5? These are both file I/O related, they're permissions.

I'm not at all sure why that warning says "JS Component Loader" but with a chrome URL.
Yeah, ECMA-262 is hostile to octal numbers for their bad leading-zero human factors.  I didn't see a huge problem, but eh, whatever, ship's sailed, not huge anyway.  Bug 524781 comment 22 is my current best idea for a fix.
Maybe it's worth establishing a solution inside toolkit, along your proposal...
(MailNews trunk throws a lot of these, for file permissions and others.)
I'm not entirely sure I'm motivated enough to push solving it everywhere, but if someone wants to do that, be my guest.  That said, I doubt httpd.js would pick it up, because the server has historically been entirely self-contained as far as JS goes.

One disadvantage to that system, of course, is that it's slower than (7 << 6) | (5 << 3) | 5 (I expect quality JS engines to constant-fold it), and maybe not sufficiently clearer.  I ordinarily don't care about the former, but if the latter is sufficiently true maybe the former is enough of a bump to change the decision.  Just something worth mentioning, at the least...
FWIW, while
   x = 0700; 
generates a deprecation warning,
   x = parseInt("0700");
does not...
Or, to be safe:
   x = parseInt("0700", 8);
Eh, might as well just have httpd.js hard-code it as bit-shifts, with a single named constant for all 0444 uses:

I've had this sitting in a tree for awhile, figured I might as well get rid of it.  I pushed this as part of another test to try last night, and it passed, which for this change seems adequate for review purposes to not have to tie anyone else up.

...or, hm.  This bug was actually about server.js, not httpd.js.  Never mind, then -- still more needed here.
Whiteboard: [leave open]
rs=me to just use the same fix in server.js. (server.js requires httpd.js, so you can just reuse the const.)
Mass closing mochitest bugs that haven't had activity in the past 5 years. Please re-open or file a new bug with modern context if this is still relevant.
Closed: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.