Closed Bug 1226178 Opened 9 years ago Closed 9 years ago

Fix deprecated octal literals warnings in Telemetry tests

Categories

(Toolkit :: Telemetry, defect, P4)

defect

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: Dexter, Assigned: chaitanya7991, Mentored)

References

(Blocks 1 open bug)

Details

(Whiteboard: [measurement:client][lang=js][good first bug])

Attachments

(1 file, 2 obsolete files)

In the log output from test_TelemetryLockCount.js and test_TelemetryLateWrites.js xpcshell tests we can spot the following warning:

LOG: Thread-1 INFO "CONSOLE_MESSAGE: (warn) [JavaScript Warning: "SyntaxError: octal literals and octal escape sequences are deprecated" {file: "c:/mozilla-central/obj-i686-pc-mingw32/_tests/xpcshell/toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js" line: 15 column: 17 source: "const RW_OWNER = 0600;
"}]"

It can be reproduced by running the tests as follows:

./mach xpcshell-test toolkit/components/telemetry/tests/unit/test_TelemetryLateWrites.js

and 

./mach xpcshell-test toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js

We can fix it by changing [0] and [1] to:

const RW_OWNER = parseInt("0600", 8);

To check that this fixes the warning, run the tests again and check that the warning is no longer reported.

[0] - https://dxr.mozilla.org/mozilla-central/rev/a2f83cbe53ac4009afa4cb2b0b8f549289b23eeb/toolkit/components/telemetry/tests/unit/test_TelemetryLateWrites.js#12
[1] - https://dxr.mozilla.org/mozilla-central/rev/a2f83cbe53ac4009afa4cb2b0b8f549289b23eeb/toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js#15
Blocks: 1201022
Whiteboard: [measurement:client][lang=js][good first bug]
Chaitanya, would you be interested in working on this bug?
Flags: needinfo?(chaitanya7991)
(In reply to Georg Fritzsche [:gfritzsche] from comment #1)
> Chaitanya, would you be interested in working on this bug?

Yes, I would like to work on this bug.
Flags: needinfo?(chaitanya7991)
Great, assigning it to you.
Let us know if you run into any problems here.
Assignee: nobody → chaitanya7991
Priority: -- → P4
Comment on attachment 8690019 [details] [diff] [review]
Made nesessary changes to avoid the warning.Please let me know if any further changes are to be made.

Review of attachment 8690019 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, this looks good! Can you update the patch with the reviewer information?
(i.e. add r=<reviewer>, "Bug 1226178 - Fix deprecated octal literals warnings in Telemetry tests. r=gfritzsche")
Attachment #8690019 - Flags: review?(gfritzsche) → review+
Attachment #8690019 - Attachment is obsolete: true
Attachment #8690024 - Flags: review?(gfritzsche)
Comment on attachment 8690024 [details] [diff] [review]
Added r=<reviewer> as by  comment 5 .

Review of attachment 8690024 [details] [diff] [review]:
-----------------------------------------------------------------

This should be r=gfritzsche, also please remove the " around the message.
Attachment #8690024 - Flags: review?(gfritzsche)
Attachment #8690024 - Attachment is obsolete: true
Attachment #8690026 - Flags: review?(gfritzsche)
Comment on attachment 8690026 [details] [diff] [review]
Made  changes as per Comment 7

Review of attachment 8690026 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, lets get this landed!
Attachment #8690026 - Flags: review?(gfritzsche) → review+
nit: ES6 allows to define octals as 0o600
https://hg.mozilla.org/mozilla-central/rev/2316f6179102
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: