diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2023-06-06 04:57:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-05 15:57:01 -0400 |
commit | d54ef02dfe4455c043c3ccb3d1d15e5fcc302756 (patch) | |
tree | d3f0a84740bbc26681a8340066b44e5b15dc9255 | |
parent | 11dd5a0ae73b4d3612de6422893a25232f930b84 (diff) |
chore: update deno_lint to 0.46.0 (#19372)
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | cli/Cargo.toml | 2 | ||||
-rw-r--r-- | ext/cache/01_cache.js | 2 | ||||
-rw-r--r-- | ext/console/01_console.js | 3 | ||||
-rw-r--r-- | ext/fetch/21_formdata.js | 3 | ||||
-rw-r--r-- | ext/fetch/22_body.js | 1 | ||||
-rw-r--r-- | ext/http/00_serve.js | 6 | ||||
-rw-r--r-- | ext/url/00_url.js | 1 | ||||
-rw-r--r-- | ext/web/06_streams.js | 1 | ||||
-rw-r--r-- | ext/web/09_file.js | 1 | ||||
-rw-r--r-- | ext/websocket/01_websocket.js | 1 | ||||
m--------- | third_party | 0 |
12 files changed, 18 insertions, 7 deletions
diff --git a/Cargo.lock b/Cargo.lock index 4ded396c9..6b2c8a906 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1101,9 +1101,9 @@ dependencies = [ [[package]] name = "deno_lint" -version = "0.45.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3867178bfb6579aaf9ed79599d3181d134f13dfcd38fdd93cae7d53a37bece8d" +checksum = "afc515e82ae97f2cc562ec482251700e96570c8fde997579629f4666e70066d7" dependencies = [ "anyhow", "deno_ast", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 885ef1c86..df045a754 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -45,7 +45,7 @@ deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] deno_doc = "0.62.0" deno_emit = "0.20.0" deno_graph = "=0.48.1" -deno_lint = { version = "0.45.0", features = ["docs"] } +deno_lint = { version = "0.46.0", features = ["docs"] } deno_lockfile.workspace = true deno_npm.workspace = true deno_runtime = { workspace = true, features = ["dont_create_runtime_snapshot", "include_js_files_for_snapshotting"] } diff --git a/ext/cache/01_cache.js b/ext/cache/01_cache.js index 9b5404acb..9476420ef 100644 --- a/ext/cache/01_cache.js +++ b/ext/cache/01_cache.js @@ -128,6 +128,7 @@ class Cache { "op_cache_put", { cacheId: this[_id], + // deno-lint-ignore prefer-primordials requestUrl: reqUrl.toString(), responseHeaders: innerResponse.headerList, requestHeaders: innerRequest.headerList, @@ -243,6 +244,7 @@ class Cache { "op_cache_match", { cacheId: this[_id], + // deno-lint-ignore prefer-primordials requestUrl: url.toString(), requestHeaders: innerRequest.headerList, }, diff --git a/ext/console/01_console.js b/ext/console/01_console.js index 11b6c549c..6cf3c6dca 100644 --- a/ext/console/01_console.js +++ b/ext/console/01_console.js @@ -37,6 +37,7 @@ const { Error, ErrorCaptureStackTrace, ErrorPrototype, + ErrorPrototypeToString, FunctionPrototypeBind, FunctionPrototypeCall, FunctionPrototypeToString, @@ -1578,7 +1579,7 @@ function inspectError(value, ctx) { if (stack?.includes("\n at")) { finalMessage += stack; } else { - finalMessage += `[${stack || value.toString()}]`; + finalMessage += `[${stack || ErrorPrototypeToString(value)}]`; } } finalMessage += ArrayPrototypeJoin( diff --git a/ext/fetch/21_formdata.js b/ext/fetch/21_formdata.js index 1ddd5f656..1f0f00088 100644 --- a/ext/fetch/21_formdata.js +++ b/ext/fetch/21_formdata.js @@ -31,6 +31,7 @@ const { SafeRegExp, Symbol, StringFromCharCode, + StringPrototypeCharCodeAt, StringPrototypeTrim, StringPrototypeSlice, StringPrototypeSplit, @@ -368,7 +369,7 @@ function parseContentDisposition(value) { function decodeLatin1StringAsUtf8(latin1String) { const buffer = new Uint8Array(latin1String.length); for (let i = 0; i < latin1String.length; i++) { - buffer[i] = latin1String.charCodeAt(i); + buffer[i] = StringPrototypeCharCodeAt(latin1String, i); } return core.decode(buffer); } diff --git a/ext/fetch/22_body.js b/ext/fetch/22_body.js index 82703af76..9fe00b144 100644 --- a/ext/fetch/22_body.js +++ b/ext/fetch/22_body.js @@ -424,6 +424,7 @@ function extractBody(object) { ObjectPrototypeIsPrototypeOf(URLSearchParamsPrototype, object) ) { // TODO(@satyarohith): not sure what primordial here. + // deno-lint-ignore prefer-primordials source = object.toString(); contentType = "application/x-www-form-urlencoded;charset=UTF-8"; } else if (ObjectPrototypeIsPrototypeOf(ReadableStreamPrototype, object)) { diff --git a/ext/http/00_serve.js b/ext/http/00_serve.js index dbdc22705..ba8080e27 100644 --- a/ext/http/00_serve.js +++ b/ext/http/00_serve.js @@ -37,6 +37,8 @@ import { import { listen, TcpConn } from "ext:deno_net/01_net.js"; import { listenTls } from "ext:deno_net/02_tls.js"; const { + ArrayPrototypeFlat, + ArrayPrototypePush, ObjectPrototypeIsPrototypeOf, PromisePrototypeCatch, SafeSet, @@ -337,7 +339,7 @@ class InnerRequest { const headers = []; const reqHeaders = op_http_get_request_headers(this.#slabId); for (let i = 0; i < reqHeaders.length; i += 2) { - headers.push([reqHeaders[i], reqHeaders[i + 1]]); + ArrayPrototypePush(headers, [reqHeaders[i], reqHeaders[i + 1]]); } return headers; } @@ -575,7 +577,7 @@ function mapToCallback(context, callback, onError) { if (headers.length == 1) { op_http_set_response_header(req, headers[0][0], headers[0][1]); } else { - op_http_set_response_headers(req, headers.flat()); + op_http_set_response_headers(req, ArrayPrototypeFlat(headers)); } } diff --git a/ext/url/00_url.js b/ext/url/00_url.js index b4bc34b92..49dd2c46f 100644 --- a/ext/url/00_url.js +++ b/ext/url/00_url.js @@ -149,6 +149,7 @@ class URLSearchParams { if (url === null) { return; } + // deno-lint-ignore prefer-primordials url[_updateUrlSearch](this.toString()); } diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js index c0cbb3049..21207c372 100644 --- a/ext/web/06_streams.js +++ b/ext/web/06_streams.js @@ -1261,6 +1261,7 @@ function readableByteStreamControllerEnqueueClonedChunkToQueue( ); } else { // TODO(lucacasonato): add SharedArrayBuffer to primordials + // deno-lint-ignore prefer-primordials cloneResult = buffer.slice(byteOffset, byteOffset + byteLength); } } catch (e) { diff --git a/ext/web/09_file.js b/ext/web/09_file.js index d65a512f9..79a9c41b2 100644 --- a/ext/web/09_file.js +++ b/ext/web/09_file.js @@ -326,6 +326,7 @@ class Blob { relativeStart -= size; relativeEnd -= size; } else { + // deno-lint-ignore prefer-primordials const chunk = part.slice( relativeStart, MathMin(part.size, relativeEnd), diff --git a/ext/websocket/01_websocket.js b/ext/websocket/01_websocket.js index c4c686b9c..e71cae44a 100644 --- a/ext/websocket/01_websocket.js +++ b/ext/websocket/01_websocket.js @@ -344,6 +344,7 @@ class WebSocket extends EventTarget { if (ObjectPrototypeIsPrototypeOf(BlobPrototype, data)) { PromisePrototypeThen( + // deno-lint-ignore prefer-primordials data.slice().arrayBuffer(), (ab) => sendTypedArray( diff --git a/third_party b/third_party -Subproject ee59830ca23fd0aa423a3905005835c586e73e7 +Subproject 7882a6c7763efbda55318e019b239bec7704765 |