Closed Bug 572890 Opened 14 years ago Closed 14 years ago

fix "octal literals and octal escape sequences are deprecated" in c-c

Categories

(MailNews Core :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mnyromyr, Assigned: mnyromyr)

References

Details

Attachments

(1 file, 1 obsolete file)

Since bug 514559, octal literals and octal escape sequences are deprecated in strict mode, resulting in *lots* of 

JS Component Loader: WARNING chrome://messenger-newsblog/content/file-utils.js:231
                     octal literals and octal escape sequences are deprecated

warnings when starting trunk SeaMonkey or Thunderbird with JS strict mode enabled, cluttering the error console.
Attachment #452112 - Flags: superreview?(bienvenu)
Attachment #452112 - Flags: review?(bienvenu)
Wouldn't it make more sense to use hex? Or use the bit shift idiom?

...
const PERM_IRWXO = 1 << 3;
const PERM_IROTH = 1 << 2;
const PERM_IWOTH = 1 << 1;
const PERM_IXOTH = 1 << 0;

In any case, the current patch needs closing parens on most of the parseInt calls, if nothing else.
Sorry, I guess it's not as simple as bit shifting. But hex would work.
Comment on attachment 452112 [details] [diff] [review]
fix octal deprecation warnings in c-c

asuth might have some thoughts on the nicest way of doing this.
Attachment #452112 - Flags: review?(bienvenu) → review?(bugmail)
Comment on attachment 452112 [details] [diff] [review]
fix octal deprecation warnings in c-c

parseInt seems like the right way to go here.  File attributes are usually expressed in octal, so use of parseInt seems consistent and (most) intuitive.

As noted, there are a bunch of parens missing and there is also a plus sign missing on PERM_RW_ALL.  Strictly speaking from a nit perspective, bitwise-or ("|") is preferable, but it ends up the same, so who cares.

r=asuth conditional on fixing the syntax errors.

Thanks for taking the initiative to fix this; I find that error annoying too!
Attachment #452112 - Flags: review?(bugmail) → review+
Comment on attachment 452112 [details] [diff] [review]
fix octal deprecation warnings in c-c

thx, Karsten, sr + conditional on the same issues...
Attachment #452112 - Flags: superreview?(bienvenu) → superreview+
Landed in comm-central as <http://hg.mozilla.org/comm-central/rev/ff4b8b04a116>.
Assignee: nobody → mnyromyr
Attachment #452112 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #452323 - Flags: superreview+
Attachment #452323 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
> +/* Notice that these valuse are octal, but octal literals are deprecated. */

Karsten, your valuse are misspelled.
*argl* I plead for not correcting an already present misspelling. :|
Also, it probably should be "Note" instead of "Notice"...
You need to log in before you can comment on or make changes to this bug.