Fix deprecated octal literals warnings in Telemetry tests

RESOLVED FIXED in Firefox 45

Status

()

Toolkit
Telemetry
P4
normal
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Dexter, Assigned: chaithanya, Mentored)

Tracking

(Blocks: 1 bug)

Trunk
mozilla45
Points:
---

Firefox Tracking Flags

(firefox45 fixed)

Details

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

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

3 years ago
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
(Reporter)

Updated

3 years ago
Blocks: 1201022
Whiteboard: [measurement:client][lang=js][good first bug]
Chaitanya, would you be interested in working on this bug?
Flags: needinfo?(chaitanya7991)
(Assignee)

Comment 2

3 years ago
(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
(Assignee)

Comment 4

3 years ago
Created attachment 8690019 [details] [diff] [review]
Made nesessary changes to avoid the warning.Please let me know if any further changes are to be made.
Attachment #8690019 - Flags: review?(gfritzsche)
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+
(Assignee)

Comment 6

3 years ago
Created attachment 8690024 [details] [diff] [review]
Added r=<reviewer> as by  comment 5 .
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)
(Assignee)

Comment 8

3 years ago
Created attachment 8690026 [details] [diff] [review]
Made  changes as per Comment 7
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+
Keywords: checkin-needed
nit: ES6 allows to define octals as 0o600

Comment 12

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/2316f6179102
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox45: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.