From f69e4794d2d016c8cdbf4a4de8affd0c92f2732c Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Wed, 22 Mar 2023 19:34:14 -0600 Subject: [PATCH] chore: update ext/ code to only use ASCII (#18371) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek Iwańczuk --- Cargo.lock | 6 +++--- ext/console/02_console.js | 26 ++++++++++++------------ ext/node/Cargo.toml | 2 +- ext/node/polyfills/internal/cli_table.ts | 26 ++++++++++++------------ ext/node/polyfills/path/glob.ts | 4 +++- ext/url/00_url.js | 2 +- ext/url/Cargo.toml | 2 +- ext/web/02_event.js | 2 +- ext/web/10_filereader.js | 16 +++++++-------- ext/web/Cargo.toml | 2 +- 10 files changed, 45 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c605144ea3..e75a6208b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1144,7 +1144,7 @@ dependencies = [ [[package]] name = "deno_node" -version = "0.31.0" +version = "0.31.1" dependencies = [ "aes", "cbc", @@ -1269,7 +1269,7 @@ dependencies = [ [[package]] name = "deno_url" -version = "0.94.0" +version = "0.94.1" dependencies = [ "deno_bench_util", "deno_core", @@ -1281,7 +1281,7 @@ dependencies = [ [[package]] name = "deno_web" -version = "0.125.0" +version = "0.125.1" dependencies = [ "async-trait", "base64-simd", diff --git a/ext/console/02_console.js b/ext/console/02_console.js index f82057771c..8c33ac3bc0 100644 --- a/ext/console/02_console.js +++ b/ext/console/02_console.js @@ -150,19 +150,19 @@ function isTypedArray(x) { } const tableChars = { - middleMiddle: "─", - rowMiddle: "┼", - topRight: "┐", - topLeft: "┌", - leftMiddle: "├", - topMiddle: "┬", - bottomRight: "┘", - bottomLeft: "└", - bottomMiddle: "┴", - rightMiddle: "┤", - left: "│ ", - right: " │", - middle: " │ ", + middleMiddle: "\u2500", + rowMiddle: "\u253c", + topRight: "\u2510", + topLeft: "\u250c", + leftMiddle: "\u251c", + topMiddle: "\u252c", + bottomRight: "\u2518", + bottomLeft: "\u2514", + bottomMiddle: "\u2534", + rightMiddle: "\u2524", + left: "\u2502 ", + right: " \u2502", + middle: " \u2502 ", }; function isFullWidthCodePoint(code) { diff --git a/ext/node/Cargo.toml b/ext/node/Cargo.toml index aeef94b965..ffdd4c07e8 100644 --- a/ext/node/Cargo.toml +++ b/ext/node/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_node" -version = "0.31.0" +version = "0.31.1" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/node/polyfills/internal/cli_table.ts b/ext/node/polyfills/internal/cli_table.ts index dd49a44a19..a3740d8892 100644 --- a/ext/node/polyfills/internal/cli_table.ts +++ b/ext/node/polyfills/internal/cli_table.ts @@ -9,19 +9,19 @@ import { getStringWidth } from "ext:deno_node/internal/util/inspect.mjs"; // core to verify that Unicode characters work in built-ins. // Refs: https://github.com/nodejs/node/issues/10673 const tableChars = { - middleMiddle: "─", - rowMiddle: "┼", - topRight: "┐", - topLeft: "┌", - leftMiddle: "├", - topMiddle: "┬", - bottomRight: "┘", - bottomLeft: "└", - bottomMiddle: "┴", - rightMiddle: "┤", - left: "│ ", - right: " │", - middle: " │ ", + middleMiddle: "\u2500", + rowMiddle: "\u253c", + topRight: "\u2510", + topLeft: "\u250c", + leftMiddle: "\u251c", + topMiddle: "\u252c", + bottomRight: "\u2518", + bottomLeft: "\u2514", + bottomMiddle: "\u2534", + rightMiddle: "\u2524", + left: "\u2502 ", + right: " \u2502", + middle: " \u2502 ", }; const renderRow = (row: string[], columnWidths: number[]) => { diff --git a/ext/node/polyfills/path/glob.ts b/ext/node/polyfills/path/glob.ts index c96965a673..de6c752d54 100644 --- a/ext/node/polyfills/path/glob.ts +++ b/ext/node/polyfills/path/glob.ts @@ -187,7 +187,9 @@ export function globToRegExp( else if (value == "lower") segment += "a-z"; else if (value == "print") segment += "\x20-\x7E"; else if (value == "punct") { - segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~"; + segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_"; + segment += "\u2018"; + segment += "{|}~"; } else if (value == "space") segment += "\\s\v"; else if (value == "upper") segment += "A-Z"; else if (value == "word") segment += "\\w"; diff --git a/ext/url/00_url.js b/ext/url/00_url.js index c288225e3e..de4fb0ec86 100644 --- a/ext/url/00_url.js +++ b/ext/url/00_url.js @@ -326,7 +326,7 @@ function trim(s) { return s; } -// Represents a "no port" value. A port in URL cannot be greater than 2^16 − 1 +// Represents a "no port" value. A port in URL cannot be greater than 2^16 - 1 const NO_PORT = 65536; const componentsBuf = new Uint32Array(8); diff --git a/ext/url/Cargo.toml b/ext/url/Cargo.toml index eb0d7a2a44..455750c391 100644 --- a/ext/url/Cargo.toml +++ b/ext/url/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_url" -version = "0.94.0" +version = "0.94.1" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/ext/web/02_event.js b/ext/web/02_event.js index f354bf1828..347344b946 100644 --- a/ext/web/02_event.js +++ b/ext/web/02_event.js @@ -996,7 +996,7 @@ class EventTarget { // If signal is not null and its aborted flag is set, then return. return; } else { - // If listener’s signal is not null, then add the following abort + // If listener's signal is not null, then add the following abort // abort steps to it: Remove an event listener. signal.addEventListener("abort", () => { self.removeEventListener(type, callback, options); diff --git a/ext/web/10_filereader.js b/ext/web/10_filereader.js index ee9b2614b8..5dd2d5c3af 100644 --- a/ext/web/10_filereader.js +++ b/ext/web/10_filereader.js @@ -58,18 +58,18 @@ class FileReader extends EventTarget { * @param {{kind: "ArrayBuffer" | "Text" | "DataUrl" | "BinaryString", encoding?: string}} readtype */ #readOperation(blob, readtype) { - // 1. If fr’s 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 fr’s state to "loading". + // 2. Set fr's state to "loading". this[state] = "loading"; - // 3. Set fr’s result to null. + // 3. Set fr's result to null. this[result] = null; - // 4. Set fr’s 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 fr’s 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, blob’s 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 fr’s 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 fr’s 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", {}); diff --git a/ext/web/Cargo.toml b/ext/web/Cargo.toml index d1afdc0ae0..1b7515d7da 100644 --- a/ext/web/Cargo.toml +++ b/ext/web/Cargo.toml @@ -2,7 +2,7 @@ [package] name = "deno_web" -version = "0.125.0" +version = "0.125.1" authors.workspace = true edition.workspace = true license.workspace = true