mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
chore: upgrade deno_core (#22124)
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
This commit is contained in:
parent
9ed713153c
commit
942fb5e038
9 changed files with 42 additions and 44 deletions
12
Cargo.lock
generated
12
Cargo.lock
generated
|
@ -1196,9 +1196,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deno_core"
|
||||
version = "0.254.0"
|
||||
version = "0.255.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd747cfefb65613073c71303f1b9817c541111dae68a2ce31b2ead5120f4222d"
|
||||
checksum = "66349d0fd8e9cad751435b59cf9e09e9fad9433301e9529ca4edf130ea3a06a0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bit-set",
|
||||
|
@ -1653,9 +1653,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deno_ops"
|
||||
version = "0.130.0"
|
||||
version = "0.131.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d2eaf696534fd715236131bbc23502c3acc975a987aaf0457528cefa4c4ccf51"
|
||||
checksum = "ee3363343cd15758aa02792e93b53b1def9cf1e8b23dd82bdce0f223e6046e76"
|
||||
dependencies = [
|
||||
"proc-macro-rules",
|
||||
"proc-macro2",
|
||||
|
@ -5357,9 +5357,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "serde_v8"
|
||||
version = "0.163.0"
|
||||
version = "0.164.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "16e8193fbdd173c08fceb226d14bef66f1d8a84ed201b3e24c1404f2171b0734"
|
||||
checksum = "f96a94476f3d22fe9f70c2d992d020173ccd61ad6fa1b62ed8090abe835c4e9f"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"derive_more",
|
||||
|
|
|
@ -42,7 +42,7 @@ repository = "https://github.com/denoland/deno"
|
|||
|
||||
[workspace.dependencies]
|
||||
deno_ast = { version = "0.32.0", features = ["transpiling"] }
|
||||
deno_core = { version = "0.254.0" }
|
||||
deno_core = { version = "0.255.0" }
|
||||
|
||||
deno_bench_util = { version = "0.129.0", path = "./bench_util" }
|
||||
deno_lockfile = "0.18.0"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import { core, internals, primordials } from "ext:core/mod.js";
|
||||
const {
|
||||
isDate,
|
||||
internalRidSymbol,
|
||||
} = core;
|
||||
const {
|
||||
op_fs_chdir,
|
||||
|
@ -655,14 +656,14 @@ function create(path) {
|
|||
}
|
||||
|
||||
class FsFile {
|
||||
[SymbolFor("Deno.internal.rid")] = 0;
|
||||
[internalRidSymbol] = 0;
|
||||
#rid = 0;
|
||||
|
||||
#readable;
|
||||
#writable;
|
||||
|
||||
constructor(rid, symbol) {
|
||||
this[SymbolFor("Deno.internal.rid")] = rid;
|
||||
this[internalRidSymbol] = rid;
|
||||
this.#rid = rid;
|
||||
if (!symbol || symbol !== SymbolFor("Deno.internal.FsFile")) {
|
||||
internals.warnOnDeprecatedApi(
|
||||
|
|
|
@ -4,6 +4,7 @@ import { core, internals, primordials } from "ext:core/mod.js";
|
|||
const {
|
||||
BadResourcePrototype,
|
||||
InterruptedPrototype,
|
||||
internalRidSymbol,
|
||||
} = core;
|
||||
const {
|
||||
op_http_close_after_finish,
|
||||
|
@ -33,7 +34,6 @@ const {
|
|||
PromisePrototypeCatch,
|
||||
PromisePrototypeThen,
|
||||
Symbol,
|
||||
SymbolFor,
|
||||
TypeError,
|
||||
TypedArrayPrototypeGetSymbolToStringTag,
|
||||
Uint8Array,
|
||||
|
@ -618,7 +618,7 @@ function serve(arg1, arg2) {
|
|||
function serveHttpOnListener(listener, signal, handler, onError, onListen) {
|
||||
const context = new CallbackContext(
|
||||
signal,
|
||||
op_http_serve(listener[SymbolFor("Deno.internal.rid")]),
|
||||
op_http_serve(listener[internalRidSymbol]),
|
||||
listener,
|
||||
);
|
||||
const callback = mapToCallback(context, handler, onError);
|
||||
|
@ -634,7 +634,7 @@ function serveHttpOnListener(listener, signal, handler, onError, onListen) {
|
|||
function serveHttpOnConnection(connection, signal, handler, onError, onListen) {
|
||||
const context = new CallbackContext(
|
||||
signal,
|
||||
op_http_serve_on(connection[SymbolFor("Deno.internal.rid")]),
|
||||
op_http_serve_on(connection[internalRidSymbol]),
|
||||
null,
|
||||
);
|
||||
const callback = mapToCallback(context, handler, onError);
|
||||
|
|
|
@ -4,6 +4,7 @@ import { core, internals, primordials } from "ext:core/mod.js";
|
|||
const {
|
||||
BadResourcePrototype,
|
||||
InterruptedPrototype,
|
||||
internalRidSymbol,
|
||||
} = core;
|
||||
const {
|
||||
op_dns_resolve,
|
||||
|
@ -40,7 +41,6 @@ const {
|
|||
SetPrototypeForEach,
|
||||
SymbolAsyncIterator,
|
||||
Symbol,
|
||||
SymbolFor,
|
||||
TypeError,
|
||||
TypedArrayPrototypeSubarray,
|
||||
Uint8Array,
|
||||
|
@ -91,7 +91,7 @@ async function resolveDns(query, recordType, options) {
|
|||
}
|
||||
|
||||
class Conn {
|
||||
[SymbolFor("Deno.internal.rid")] = 0;
|
||||
[internalRidSymbol] = 0;
|
||||
#rid = 0;
|
||||
#remoteAddr = null;
|
||||
#localAddr = null;
|
||||
|
@ -102,7 +102,7 @@ class Conn {
|
|||
#writable;
|
||||
|
||||
constructor(rid, remoteAddr, localAddr) {
|
||||
this[SymbolFor("Deno.internal.rid")] = rid;
|
||||
this[internalRidSymbol] = rid;
|
||||
this.#rid = rid;
|
||||
this.#remoteAddr = remoteAddr;
|
||||
this.#localAddr = localAddr;
|
||||
|
@ -201,12 +201,12 @@ class Conn {
|
|||
}
|
||||
|
||||
class TcpConn extends Conn {
|
||||
[SymbolFor("Deno.internal.rid")] = 0;
|
||||
[internalRidSymbol] = 0;
|
||||
#rid = 0;
|
||||
|
||||
constructor(rid, remoteAddr, localAddr) {
|
||||
super(rid, remoteAddr, localAddr);
|
||||
this[SymbolFor("Deno.internal.rid")] = rid;
|
||||
this[internalRidSymbol] = rid;
|
||||
this.#rid = rid;
|
||||
}
|
||||
|
||||
|
@ -229,12 +229,12 @@ class TcpConn extends Conn {
|
|||
}
|
||||
|
||||
class UnixConn extends Conn {
|
||||
[SymbolFor("Deno.internal.rid")] = 0;
|
||||
[internalRidSymbol] = 0;
|
||||
#rid = 0;
|
||||
|
||||
constructor(rid, remoteAddr, localAddr) {
|
||||
super(rid, remoteAddr, localAddr);
|
||||
this[SymbolFor("Deno.internal.rid")] = rid;
|
||||
this[internalRidSymbol] = rid;
|
||||
this.#rid = rid;
|
||||
}
|
||||
|
||||
|
@ -249,14 +249,14 @@ class UnixConn extends Conn {
|
|||
}
|
||||
|
||||
class Listener {
|
||||
[SymbolFor("Deno.internal.rid")] = 0;
|
||||
[internalRidSymbol] = 0;
|
||||
#rid = 0;
|
||||
#addr = null;
|
||||
#unref = false;
|
||||
#promise = null;
|
||||
|
||||
constructor(rid, addr) {
|
||||
this[SymbolFor("Deno.internal.rid")] = rid;
|
||||
this[internalRidSymbol] = rid;
|
||||
this.#rid = rid;
|
||||
this.#addr = addr;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { core, internals, primordials } from "ext:core/mod.js";
|
||||
const { internalRidSymbol } = core;
|
||||
const {
|
||||
op_net_accept_tls,
|
||||
op_net_connect_tls,
|
||||
|
@ -10,7 +11,6 @@ const {
|
|||
} = core.ensureFastOps();
|
||||
const {
|
||||
Number,
|
||||
SymbolFor,
|
||||
TypeError,
|
||||
} = primordials;
|
||||
|
||||
|
@ -25,12 +25,12 @@ function opTlsHandshake(rid) {
|
|||
}
|
||||
|
||||
class TlsConn extends Conn {
|
||||
[SymbolFor("Deno.internal.rid")] = 0;
|
||||
[internalRidSymbol] = 0;
|
||||
#rid = 0;
|
||||
|
||||
constructor(rid, remoteAddr, localAddr) {
|
||||
super(rid, remoteAddr, localAddr);
|
||||
this[SymbolFor("Deno.internal.rid")] = rid;
|
||||
this[internalRidSymbol] = rid;
|
||||
this.#rid = rid;
|
||||
}
|
||||
|
||||
|
@ -78,12 +78,12 @@ async function connectTls({
|
|||
}
|
||||
|
||||
class TlsListener extends Listener {
|
||||
[SymbolFor("Deno.internal.rid")] = 0;
|
||||
[internalRidSymbol] = 0;
|
||||
#rid = 0;
|
||||
|
||||
constructor(rid, addr) {
|
||||
super(rid, addr);
|
||||
this[SymbolFor("Deno.internal.rid")] = rid;
|
||||
this[internalRidSymbol] = rid;
|
||||
this.#rid = rid;
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ async function startTls(
|
|||
} = {},
|
||||
) {
|
||||
const { 0: rid, 1: localAddr, 2: remoteAddr } = await opStartTls({
|
||||
rid: conn[SymbolFor("Deno.internal.rid")],
|
||||
rid: conn[internalRidSymbol],
|
||||
hostname,
|
||||
certFile,
|
||||
caCerts,
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// TODO(petamoriken): enable prefer-primordials for node polyfills
|
||||
// deno-lint-ignore-file prefer-primordials
|
||||
|
||||
import { core } from "ext:core/mod.js";
|
||||
const { internalRidSymbol } = core;
|
||||
import {
|
||||
O_APPEND,
|
||||
O_CREAT,
|
||||
|
@ -137,7 +139,7 @@ export function open(
|
|||
path as string,
|
||||
convertFlagAndModeToOptions(flags as openFlags, mode),
|
||||
).then(
|
||||
(file) => callback!(null, file[Symbol.for("Deno.internal.rid")]),
|
||||
(file) => callback!(null, file[internalRidSymbol]),
|
||||
(err) => (callback as (err: Error) => void)(err),
|
||||
);
|
||||
}
|
||||
|
@ -189,7 +191,7 @@ export function openSync(
|
|||
return Deno.openSync(
|
||||
path as string,
|
||||
convertFlagAndModeToOptions(flags, mode),
|
||||
)[Symbol.for("Deno.internal.rid")];
|
||||
)[internalRidSymbol];
|
||||
}
|
||||
|
||||
function existenceCheckRequired(flags: openFlags | number) {
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
// deno-lint-ignore-file prefer-primordials
|
||||
|
||||
import { core } from "ext:core/mod.js";
|
||||
const { internalRidSymbol } = core;
|
||||
const {
|
||||
op_can_write_vectored,
|
||||
op_raw_write_vectored,
|
||||
|
@ -46,8 +47,6 @@ import {
|
|||
} from "ext:deno_node/internal_binding/async_wrap.ts";
|
||||
import { codeMap } from "ext:deno_node/internal_binding/uv.ts";
|
||||
|
||||
const DENO_RID_SYMBOL = Symbol.for("Deno.internal.rid");
|
||||
|
||||
interface Reader {
|
||||
read(p: Uint8Array): Promise<number | null>;
|
||||
}
|
||||
|
@ -205,7 +204,7 @@ export class LibuvStreamWrap extends HandleWrap {
|
|||
allBuffers: boolean,
|
||||
): number {
|
||||
const supportsWritev = this.provider === providerType.TCPSERVERWRAP;
|
||||
const rid = this[kStreamBaseField]![DENO_RID_SYMBOL];
|
||||
const rid = this[kStreamBaseField]![internalRidSymbol];
|
||||
// Fast case optimization: two chunks, and all buffers.
|
||||
if (
|
||||
chunks.length === 2 && allBuffers && supportsWritev &&
|
||||
|
@ -319,14 +318,14 @@ export class LibuvStreamWrap extends HandleWrap {
|
|||
async #read() {
|
||||
let buf = this.#buf;
|
||||
let nread: number | null;
|
||||
const ridBefore = this[kStreamBaseField]![DENO_RID_SYMBOL];
|
||||
const ridBefore = this[kStreamBaseField]![internalRidSymbol];
|
||||
try {
|
||||
nread = await this[kStreamBaseField]!.read(buf);
|
||||
} catch (e) {
|
||||
// Try to read again if the underlying stream resource
|
||||
// changed. This can happen during TLS upgrades (eg. STARTTLS)
|
||||
if (
|
||||
ridBefore != this[kStreamBaseField]![DENO_RID_SYMBOL]
|
||||
ridBefore != this[kStreamBaseField]![internalRidSymbol]
|
||||
) {
|
||||
return this.#read();
|
||||
}
|
||||
|
@ -377,7 +376,7 @@ export class LibuvStreamWrap extends HandleWrap {
|
|||
async #write(req: WriteWrap<LibuvStreamWrap>, data: Uint8Array) {
|
||||
const { byteLength } = data;
|
||||
|
||||
const ridBefore = this[kStreamBaseField]![DENO_RID_SYMBOL];
|
||||
const ridBefore = this[kStreamBaseField]![internalRidSymbol];
|
||||
|
||||
let nwritten = 0;
|
||||
try {
|
||||
|
@ -391,7 +390,7 @@ export class LibuvStreamWrap extends HandleWrap {
|
|||
// Try to read again if the underlying stream resource
|
||||
// changed. This can happen during TLS upgrades (eg. STARTTLS)
|
||||
if (
|
||||
ridBefore != this[kStreamBaseField]![DENO_RID_SYMBOL]
|
||||
ridBefore != this[kStreamBaseField]![internalRidSymbol]
|
||||
) {
|
||||
return this.#write(req, data.subarray(nwritten));
|
||||
}
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||
import { core, internals, primordials } from "ext:core/mod.js";
|
||||
const {
|
||||
op_http_start,
|
||||
} = core.ensureFastOps();
|
||||
const {
|
||||
SymbolFor,
|
||||
} = primordials;
|
||||
import { core, internals } from "ext:core/mod.js";
|
||||
const { internalRidSymbol } = core;
|
||||
const { op_http_start } = core.ensureFastOps();
|
||||
|
||||
import { HttpConn } from "ext:deno_http/01_http.js";
|
||||
|
||||
|
@ -15,7 +11,7 @@ function serveHttp(conn) {
|
|||
new Error().stack,
|
||||
"Use `Deno.serve()` instead.",
|
||||
);
|
||||
const rid = op_http_start(conn[SymbolFor("Deno.internal.rid")]);
|
||||
const rid = op_http_start(conn[internalRidSymbol]);
|
||||
return new HttpConn(rid, conn.remoteAddr, conn.localAddr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue