-
Notifications
You must be signed in to change notification settings - Fork 22.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference for stage-3 arraybuffer-base64 #36387
Conversation
files/en-us/web/javascript/reference/global_objects/uint8array/fromhex/index.md
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I left a few comments, which you can take or not.
files/en-us/web/javascript/reference/global_objects/uint8array/frombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/frombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/frombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/frombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/fromhex/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/setfrombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/setfrombase64/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/setfrombase64/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Kevin Gibbons <[email protected]>
LGTM |
@@ -62,8 +62,6 @@ console.log(self.btoa(ok)); // YQ== | |||
console.log(self.btoa(notOK)); // error | |||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about replace this whole section with
Base64, by design, expects binary data as its input. In terms of JavaScript strings, this means strings in which the code point of each character occupies only one byte. So if you pass a string into
btoa()
containing characters that occupy more than one byte, you will get an error, because this is not considered binary data.For more information and workarounds see [LINK TO YOUR WINDOW info]
Or for consistency duplicate the content that you added in Window.btoa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to not update non-JS pages in this PR... I only did:
- Add links to JS in the glossary
- Move stuff that are no longer pertinent thanks to the new JS API out of glossary
- Remove references to glossary because the referenced section doesn't exist anymore, and readers would generally know to check
Window.btoa
when they are onWorkerGlobalScope.btoa
anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disagree - mostly on 3. I've made the edit myself so I can merge this.
files/en-us/web/javascript/reference/global_objects/uint8array/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/setfrombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/setfrombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/setfrombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/setfrombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/setfromhex/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/setfromhex/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/setfromhex/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/tobase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/frombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/frombase64/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/fromhex/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/fromhex/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/tobase64/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/uint8array/fromhex/index.md
Outdated
Show resolved
Hide resolved
5be192a
to
450fcd8
Compare
…/setfrombase64/index.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sorting this out @Josh-Cena. Very clear, as usual.
This adds documentation for a new API: https://github.com/tc39/proposal-arraybuffer-base64. Based on tc39/proposal-arraybuffer-base64#51, it is in FF 133 and Safari TP 202.
cc @bakkot