[Outreachy] Ship Uint8Array to/from base64 and hex
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
People
(Reporter: dminor, Assigned: temidayoazeez032)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
The initial support for this landed in Firefox 126, I think we can consider shipping this in the next few releases.
Updated•3 months ago
|
Reporter | ||
Updated•2 months ago
|
Reporter | ||
Comment 1•2 months ago
|
||
This bug is to ship a new feature in SpiderMonkey. There's a checklist in the build system documentation, specifically the part that says "Ship the feature".
This feature is controlled by the "javascript.options.experimental.uint8array_base64" preference.
To enable it, do the following:
- Change the default value from "false" to "true" in StaticPrefList.yaml
- Move the preference block outside of the
#ifdef NIGHTLY
block, e.g. to here. Moving it outside of#ifdef NIGHTLY
will make it available on beta and release versions of Firefox. - Similarly, we need to move the check in JSObject.cpp outside of the
#ifdef NIGHTLY
block, by moving the code just above the#ifdef NIGHTLY
block. - And in one last place, we also need to do this in js/src/shell/js.cpp :)
- Once this is done, you need to check to see if changes are necessary to
js/xpconnect/tests/chrome/test_xrayToJS.xhtml
. This is a browser test, not a SpiderMonkey shell test, so you would need to modify your mozconfig to build the full browser. If you're not able to do this (building the full browser can be challenging on older computers) please put your work in progress up for review here, and I will run the test for you on my system, and let you know if any changes are necessary.
Updated•2 months ago
|
Comment 5•2 months ago
|
||
Backed out for causing Linux spider monkey failures
Backout link: https://hg.mozilla.org/integration/autoland/rev/fb56cc35da7aa597751e9c08a95ed5dd4938853f
I am not sure what might be causing the failure.
Reporter | ||
Comment 7•2 months ago
•
|
||
This change added four new methods to the Uint8Array constructor: setFromBase64, setFromHex, toBase64, toHex. We probably weren't running this test with --enable-uint8array-base64 previously.
We need to modify the failing test as follows:
- assertEq(props.length, 2);
+ if (ctor === Uint8Array) {
+ assertEq(props.length, 6);
+ } else {
+ assertEq(props.length, 2);
+ }
Please amend your current commit to include this change to the test and resubmit for review.
Comment 9•2 months ago
|
||
bugherder |
Comment 10•2 months ago
|
||
Could you consider nominating this for a release note? (Process info)
Reporter | ||
Updated•2 months ago
|
Reporter | ||
Comment 11•2 months ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: This enables new functionality on UInt8Array allowing for conversion to and from base64 and hex encoding. Developers commonly need to write their own code or use a library to do this.
[Affects Firefox for Android]: Yes.
[Suggested wording]: Methods are now available on UInt8Array to allow for conversion to and from Base64 and hexadecimal encodings, this is an implementation of a Stage 3 TC39 proposal, for more details see the proposal text at https://github.com/tc39/proposal-arraybuffer-base64.
[Links (documentation, blog post, etc)]: https://github.com/tc39/proposal-arraybuffer-base64
Comment 12•2 months ago
|
||
Thanks, added to the Fx133 nightly release notes, please allow 30 minutes for the site to update.
Keeping the relnote-firefox flag as ? to keep it on the radar for inclusion in the final Fx133 release notes.
Comment 13•1 month ago
|
||
FYI MDN docs work for this done - see https://github.com/mdn/content/issues/36547
Comment 14•17 days ago
|
||
Added to the Fx133 release notes.
Available to preview on staging, please allow 30 minutes for the site to update.
Description
•