Closed Bug 998065 Opened 10 years ago Closed 10 years ago

scratchpad tests should use proper octal literals

Categories

(DevTools Graveyard :: Scratchpad, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 31

People

(Reporter: froydnj, Assigned: lviknesh)

Details

(Whiteboard: [good first bug][mentor=froydnj][lang=javascript])

Attachments

(1 file)

Some of the scratchpad tests produce output like:

09:22:02     INFO -  System JS : WARNING chrome://mochitests/content/browser/browser/devtools/scratchpad/test/browser_scratchpad_recent_files.js:196 - octal literals and octal escape sequences are deprecated
09:22:03     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/devtools/scratchpad/test/browser_scratchpad_recent_files.js | Console message: [JavaScript Warning: "octal literals and octal escape sequences are deprecated" {file: "chrome://mochitests/content/browser/browser/devtools/scratchpad/test/browser_scratchpad_recent_files.js" line: 196 column: 50 source: "  aFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666);

which just clutters up the logs.  The new syntax is to use 0o prefixes, similar to the 0x prefix used for hexadecimal numbers.  So the above line should be modified to use 0o666 instead of 0666.

The lines in question are:

browser/devtools/scratchpad/test/browser_scratchpad_recent_files.js:196
browser/devtools/scratchpad/test/browser_scratchpad_recent_files.js:202
browser/devtools/scratchpad/test/browser_scratchpad_reset_undo.js:48
browser/devtools/scratchpad/test/browser_scratchpad_reset_undo.js:51
browser/devtools/scratchpad/test/browser_scratchpad_reset_undo.js:57
browser/devtools/scratchpad/test/browser_scratchpad_reset_undo.js:62
browser/devtools/scratchpad/test/browser_scratchpad_revert_to_saved.js:101
browser/devtools/scratchpad/test/browser_scratchpad_revert_to_saved.js:107
Sir , 
  I just need to change 0666 to 0o666 ? . No more than that ?
(In reply to vikneshwar from comment #1)
> Sir , 
>   I just need to change 0666 to 0o666 ? . No more than that ?

Some cases may have 0644 or similar, which you would need to change to 0o644.  But nothing more complicated than that.
Attachment #8410444 - Flags: review?(nfroyd)
Comment on attachment 8410444 [details] [diff] [review]
added-octal-prefix

Great, thank you!
Attachment #8410444 - Flags: review?(nfroyd) → review+
Keywords: checkin-needed
landed on https://hg.mozilla.org/integration/fx-team/rev/f63f6fb5e5af

Congrats and thanks for contributing to Mozilla!
Keywords: checkin-needed
Whiteboard: [good first bug][mentor=froydnj][lang=javascript] → [good first bug][mentor=froydnj][lang=javascript][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/f63f6fb5e5af
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [good first bug][mentor=froydnj][lang=javascript][fixed-in-fx-team] → [good first bug][mentor=froydnj][lang=javascript]
Target Milestone: --- → Firefox 31
vikraneshwar, a good follow-up might be to find other places in the code where octal literals can be changed similarly.
Assignee: nobody → lviknesh
Product: Firefox → DevTools
Product: DevTools → DevTools Graveyard
You need to log in before you can comment on or make changes to this bug.