chore: update ext/ code to only use ASCII (#18371)

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Matt Mastracci 2023-03-22 19:34:14 -06:00 committed by GitHub
parent d06fdf6add
commit f69e4794d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 45 additions and 43 deletions

View file

@ -58,18 +58,18 @@ class FileReader extends EventTarget {
* @param {{kind: "ArrayBuffer" | "Text" | "DataUrl" | "BinaryString", encoding?: string}} readtype
*/
#readOperation(blob, readtype) {
// 1. If frs state is "loading", throw an InvalidStateError DOMException.
// 1. If fr's state is "loading", throw an InvalidStateError DOMException.
if (this[state] === "loading") {
throw new DOMException(
"Invalid FileReader state.",
"InvalidStateError",
);
}
// 2. Set frs state to "loading".
// 2. Set fr's state to "loading".
this[state] = "loading";
// 3. Set frs result to null.
// 3. Set fr's result to null.
this[result] = null;
// 4. Set frs error to null.
// 4. Set fr's error to null.
this[error] = null;
// We set this[aborted] to a new object, and keep track of it in a
@ -146,9 +146,9 @@ class FileReader extends EventTarget {
// TODO(lucacasonato): this is wrong, should be HTML "queue a task"
queueMicrotask(() => {
if (abortedState.aborted) return;
// 1. Set frs state to "done".
// 1. Set fr's state to "done".
this[state] = "done";
// 2. Let result be the result of package data given bytes, type, blobs type, and encodingName.
// 2. Let result be the result of package data given bytes, type, blob's type, and encodingName.
const size = ArrayPrototypeReduce(
chunks,
(p, i) => p + i.byteLength,
@ -218,7 +218,7 @@ class FileReader extends EventTarget {
this.dispatchEvent(ev);
}
// 5. If frs state is not "loading", fire a progress event called loadend at the fr.
// 5. If fr's state is not "loading", fire a progress event called loadend at the fr.
//Note: Event handler for the load or error events could have started another load, if that happens the loadend event for this load is not fired.
if (this[state] !== "loading") {
const ev = new ProgressEvent("loadend", {
@ -245,7 +245,7 @@ class FileReader extends EventTarget {
this.dispatchEvent(ev);
}
//If frs state is not "loading", fire a progress event called loadend at fr.
//If fr's state is not "loading", fire a progress event called loadend at fr.
//Note: Event handler for the error event could have started another load, if that happens the loadend event for this load is not fired.
if (this[state] !== "loading") {
const ev = new ProgressEvent("loadend", {});