Use standard pad functions in Telemetry JS modules

RESOLVED FIXED in Firefox 54

Status

()

P4
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: gfritzsche, Assigned: flyingrub, Mentored)

Tracking

(Blocks: 1 bug)

Trunk
mozilla54
Points:
---

Firefox Tracking Flags

(firefox54 fixed)

Details

(Whiteboard: [measurement:client] [lang=js])

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
We use some custom padding code in Telemetry:
https://dxr.mozilla.org/mozilla-central/search?q=path%3Atoolkit%2Fcomponents%2Ftelemetry+pad+ext%3Ajs+ext%3Ajsm&redirect=false

JS now has standard padding functions though:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd

We should update the code to use them.
To confirm the changes are working, the Telemetry tests can be run with:
mach test toolkit/components/telemetry/tests/unit/
(Assignee)

Comment 1

2 years ago
padStart & padEnd function are not available with node, should we add the Polyfill to the file ? or perhaps modules/TelemetryUtils.jsm ?
(Reporter)

Comment 2

2 years ago
We don't need any polyfills.
This code only ships with Firefox and runs on its most recent JS engine.
Comment hidden (mozreview-request)
(Assignee)

Updated

2 years ago
Attachment #8842516 - Flags: review?(gfritzsche)
Comment hidden (mozreview-request)
(Assignee)

Comment 5

2 years ago
mozreview-review
Comment on attachment 8842516 [details]
Bug 1342394 - Use standard pad functions in Telemetry JS modules

https://reviewboard.mozilla.org/r/116322/#review117940
I would like to help in this. could you give some steps for get start please
(Reporter)

Updated

2 years ago
Assignee: nobody → flyinggrub
(Reporter)

Comment 7

2 years ago
mozreview-review
Comment on attachment 8842516 [details]
Bug 1342394 - Use standard pad functions in Telemetry JS modules

https://reviewboard.mozilla.org/r/116322/#review118936

This looks good, thanks!
Attachment #8842516 - Flags: review?(gfritzsche) → review+
(Assignee)

Updated

2 years ago
Keywords: checkin-needed

Comment 8

2 years ago
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1406a5dfed25
Use standard pad functions in Telemetry JS modules r=gfritzsche
Keywords: checkin-needed

Comment 9

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