1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

fix: upgrade deno_core to 0.291.0 (#24297)

This commit is contained in:
Divy Srivastava 2024-06-21 10:49:39 +05:30 committed by GitHub
parent 88e3f465d3
commit b4939f3379
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 36 additions and 31 deletions

12
Cargo.lock generated
View file

@ -1281,9 +1281,9 @@ dependencies = [
[[package]] [[package]]
name = "deno_core" name = "deno_core"
version = "0.290.0" version = "0.291.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48ba7176428b2dd879e8bdb38075c0e355f7e6b6280d0d11591e14c2e092edc5" checksum = "ec3d6bd1d8fc2858208a55aa492d43d92de7d42b9f434f0a7ed251befaf27a3c"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bincode",
@ -1738,9 +1738,9 @@ dependencies = [
[[package]] [[package]]
name = "deno_ops" name = "deno_ops"
version = "0.166.0" version = "0.167.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b4e924b7703ff1ec71b38d0c2b09efcd7ff19a2a8ce5be11b712c22ea9fd1ba" checksum = "b573e543149e9a37cdf9cf37b88d778215a8eff7da8211b94f84d3d155cfe3f5"
dependencies = [ dependencies = [
"proc-macro-rules", "proc-macro-rules",
"proc-macro2", "proc-macro2",
@ -5745,9 +5745,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_v8" name = "serde_v8"
version = "0.199.0" version = "0.200.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b467186012b61a4754390c7a4304db281ee91f5686210584ea0c09894497d27f" checksum = "579057484ec81c031826ca53bc5b4ab5d1273fcd5cc4c8057c0f0cd1e57dfa65"
dependencies = [ dependencies = [
"num-bigint", "num-bigint",
"serde", "serde",

View file

@ -44,7 +44,7 @@ repository = "https://github.com/denoland/deno"
[workspace.dependencies] [workspace.dependencies]
deno_ast = { version = "=0.39.2", features = ["transpiling"] } deno_ast = { version = "=0.39.2", features = ["transpiling"] }
deno_core = { version = "0.290.0" } deno_core = { version = "0.291.0" }
deno_bench_util = { version = "0.152.0", path = "./bench_util" } deno_bench_util = { version = "0.152.0", path = "./bench_util" }
deno_lockfile = "0.20.0" deno_lockfile = "0.20.0"

View file

@ -195,41 +195,34 @@ pub struct StartTlsArgs {
} }
#[op2] #[op2]
pub fn op_tls_key_null<'s>( #[cppgc]
scope: &mut v8::HandleScope<'s>, pub fn op_tls_key_null() -> TlsKeysHolder {
) -> Result<v8::Local<'s, v8::Object>, AnyError> { TlsKeysHolder::from(TlsKeys::Null)
Ok(deno_core::cppgc::make_cppgc_object(
scope,
TlsKeysHolder::from(TlsKeys::Null),
))
} }
#[op2] #[op2]
pub fn op_tls_key_static<'s>( #[cppgc]
scope: &mut v8::HandleScope<'s>, pub fn op_tls_key_static(
#[string] cert: String, #[string] cert: &str,
#[string] key: String, #[string] key: &str,
) -> Result<v8::Local<'s, v8::Object>, AnyError> { ) -> Result<TlsKeysHolder, AnyError> {
let cert = load_certs(&mut BufReader::new(cert.as_bytes()))?; let cert = load_certs(&mut BufReader::new(cert.as_bytes()))?;
let key = load_private_keys(key.as_bytes())? let key = load_private_keys(key.as_bytes())?
.into_iter() .into_iter()
.next() .next()
.unwrap(); .unwrap();
Ok(deno_core::cppgc::make_cppgc_object( Ok(TlsKeysHolder::from(TlsKeys::Static(TlsKey(cert, key))))
scope,
TlsKeysHolder::from(TlsKeys::Static(TlsKey(cert, key))),
))
} }
/// Legacy op -- will be removed in Deno 2.0. /// Legacy op -- will be removed in Deno 2.0.
#[op2] #[op2]
pub fn op_tls_key_static_from_file<'s, NP>( #[cppgc]
pub fn op_tls_key_static_from_file<NP>(
state: &mut OpState, state: &mut OpState,
scope: &mut v8::HandleScope<'s>,
#[string] api: String, #[string] api: String,
#[string] cert_file: String, #[string] cert_file: String,
#[string] key_file: String, #[string] key_file: String,
) -> Result<v8::Local<'s, v8::Object>, AnyError> ) -> Result<TlsKeysHolder, AnyError>
where where
NP: NetPermissions + 'static, NP: NetPermissions + 'static,
{ {
@ -244,10 +237,7 @@ where
.into_iter() .into_iter()
.next() .next()
.unwrap(); .unwrap();
Ok(deno_core::cppgc::make_cppgc_object( Ok(TlsKeysHolder::from(TlsKeys::Static(TlsKey(cert, key))))
scope,
TlsKeysHolder::from(TlsKeys::Static(TlsKey(cert, key))),
))
} }
#[op2] #[op2]

View file

@ -22,6 +22,8 @@ pub struct BlockListResource {
blocklist: RefCell<BlockList>, blocklist: RefCell<BlockList>,
} }
impl deno_core::GcResource for BlockListResource {}
#[derive(Serialize)] #[derive(Serialize)]
struct SocketAddressSerialization(String, String); struct SocketAddressSerialization(String, String);

View file

@ -19,6 +19,8 @@ pub(crate) struct Certificate {
cert: X509Certificate<'static>, cert: X509Certificate<'static>,
} }
impl deno_core::GcResource for Certificate {}
impl Certificate { impl Certificate {
fn fingerprint<D: Digest>(&self) -> Option<String> { fn fingerprint<D: Digest>(&self) -> Option<String> {
self.pem.as_ref().map(|pem| { self.pem.as_ref().map(|pem| {

View file

@ -29,6 +29,8 @@ pub struct Script {
inner: i::ContextifyScript, inner: i::ContextifyScript,
} }
impl deno_core::GcResource for Script {}
impl Script { impl Script {
fn new( fn new(
scope: &mut v8::HandleScope, scope: &mut v8::HandleScope,

View file

@ -64,6 +64,8 @@ pub struct ContextifyContext {
sandbox: v8::Global<v8::Object>, sandbox: v8::Global<v8::Object>,
} }
impl deno_core::GcResource for ContextifyContext {}
impl ContextifyContext { impl ContextifyContext {
pub fn attach( pub fn attach(
scope: &mut v8::HandleScope, scope: &mut v8::HandleScope,
@ -125,7 +127,7 @@ impl ContextifyContext {
} }
pub fn from_sandbox_obj<'a>( pub fn from_sandbox_obj<'a>(
scope: &mut v8::HandleScope, scope: &mut v8::HandleScope<'a>,
sandbox_obj: v8::Local<v8::Object>, sandbox_obj: v8::Local<v8::Object>,
) -> Option<&'a Self> { ) -> Option<&'a Self> {
let private_str = let private_str =
@ -136,6 +138,7 @@ impl ContextifyContext {
.get_private(scope, private_symbol) .get_private(scope, private_symbol)
.and_then(|wrapper| { .and_then(|wrapper| {
deno_core::cppgc::try_unwrap_cppgc_object::<Self>(wrapper) deno_core::cppgc::try_unwrap_cppgc_object::<Self>(wrapper)
.map(|s| s as _)
}) })
} }

View file

@ -233,6 +233,8 @@ struct Zlib {
inner: RefCell<Option<ZlibInner>>, inner: RefCell<Option<ZlibInner>>,
} }
impl deno_core::GcResource for Zlib {}
impl deno_core::Resource for Zlib { impl deno_core::Resource for Zlib {
fn name(&self) -> Cow<str> { fn name(&self) -> Cow<str> {
"zlib".into() "zlib".into()

View file

@ -50,6 +50,8 @@ pub enum TlsKeys {
pub struct TlsKeysHolder(RefCell<TlsKeys>); pub struct TlsKeysHolder(RefCell<TlsKeys>);
impl deno_core::GcResource for TlsKeysHolder {}
impl TlsKeysHolder { impl TlsKeysHolder {
pub fn take(&self) -> TlsKeys { pub fn take(&self) -> TlsKeys {
std::mem::take(&mut *self.0.borrow_mut()) std::mem::take(&mut *self.0.borrow_mut())
@ -222,6 +224,8 @@ pub struct TlsKeyLookup {
RefCell<HashMap<String, broadcast::Sender<Result<TlsKey, ErrorType>>>>, RefCell<HashMap<String, broadcast::Sender<Result<TlsKey, ErrorType>>>>,
} }
impl deno_core::GcResource for TlsKeyLookup {}
impl TlsKeyLookup { impl TlsKeyLookup {
/// Multiple `poll` calls are safe, but this method is not starvation-safe. Generally /// Multiple `poll` calls are safe, but this method is not starvation-safe. Generally
/// only one `poll`er should be active at any time. /// only one `poll`er should be active at any time.