Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: upgrade deno_core to 0.291.0 #24297

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ repository = "https://github.com/denoland/deno"

[workspace.dependencies]
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_lockfile = "0.20.0"
Expand Down
36 changes: 13 additions & 23 deletions ext/net/ops_tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,41 +195,34 @@ pub struct StartTlsArgs {
}

#[op2]
pub fn op_tls_key_null<'s>(
scope: &mut v8::HandleScope<'s>,
) -> Result<v8::Local<'s, v8::Object>, AnyError> {
Ok(deno_core::cppgc::make_cppgc_object(
scope,
TlsKeysHolder::from(TlsKeys::Null),
))
#[cppgc]
pub fn op_tls_key_null() -> TlsKeysHolder {
TlsKeysHolder::from(TlsKeys::Null)
}

#[op2]
pub fn op_tls_key_static<'s>(
scope: &mut v8::HandleScope<'s>,
#[string] cert: String,
#[string] key: String,
) -> Result<v8::Local<'s, v8::Object>, AnyError> {
#[cppgc]
pub fn op_tls_key_static(
#[string] cert: &str,
#[string] key: &str,
) -> Result<TlsKeysHolder, AnyError> {
let cert = load_certs(&mut BufReader::new(cert.as_bytes()))?;
let key = load_private_keys(key.as_bytes())?
.into_iter()
.next()
.unwrap();
Ok(deno_core::cppgc::make_cppgc_object(
scope,
TlsKeysHolder::from(TlsKeys::Static(TlsKey(cert, key))),
))
Ok(TlsKeysHolder::from(TlsKeys::Static(TlsKey(cert, key))))
}

/// Legacy op -- will be removed in Deno 2.0.
#[op2]
pub fn op_tls_key_static_from_file<'s, NP>(
#[cppgc]
pub fn op_tls_key_static_from_file<NP>(
state: &mut OpState,
scope: &mut v8::HandleScope<'s>,
#[string] api: String,
#[string] cert_file: String,
#[string] key_file: String,
) -> Result<v8::Local<'s, v8::Object>, AnyError>
) -> Result<TlsKeysHolder, AnyError>
where
NP: NetPermissions + 'static,
{
Expand All @@ -244,10 +237,7 @@ where
.into_iter()
.next()
.unwrap();
Ok(deno_core::cppgc::make_cppgc_object(
scope,
TlsKeysHolder::from(TlsKeys::Static(TlsKey(cert, key))),
))
Ok(TlsKeysHolder::from(TlsKeys::Static(TlsKey(cert, key))))
}

#[op2]
Expand Down
2 changes: 2 additions & 0 deletions ext/node/ops/blocklist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ pub struct BlockListResource {
blocklist: RefCell<BlockList>,
}

impl deno_core::GcResource for BlockListResource {}

#[derive(Serialize)]
struct SocketAddressSerialization(String, String);

Expand Down
2 changes: 2 additions & 0 deletions ext/node/ops/crypto/x509.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pub(crate) struct Certificate {
cert: X509Certificate<'static>,
}

impl deno_core::GcResource for Certificate {}

impl Certificate {
fn fingerprint<D: Digest>(&self) -> Option<String> {
self.pem.as_ref().map(|pem| {
Expand Down
2 changes: 2 additions & 0 deletions ext/node/ops/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pub struct Script {
inner: i::ContextifyScript,
}

impl deno_core::GcResource for Script {}

impl Script {
fn new(
scope: &mut v8::HandleScope,
Expand Down
5 changes: 4 additions & 1 deletion ext/node/ops/vm_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ pub struct ContextifyContext {
sandbox: v8::Global<v8::Object>,
}

impl deno_core::GcResource for ContextifyContext {}

impl ContextifyContext {
pub fn attach(
scope: &mut v8::HandleScope,
Expand Down Expand Up @@ -125,7 +127,7 @@ impl ContextifyContext {
}

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

Expand Down
2 changes: 2 additions & 0 deletions ext/node/ops/zlib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ struct Zlib {
inner: RefCell<Option<ZlibInner>>,
}

impl deno_core::GcResource for Zlib {}

impl deno_core::Resource for Zlib {
fn name(&self) -> Cow<str> {
"zlib".into()
Expand Down
4 changes: 4 additions & 0 deletions ext/tls/tls_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ pub enum TlsKeys {

pub struct TlsKeysHolder(RefCell<TlsKeys>);

impl deno_core::GcResource for TlsKeysHolder {}

impl TlsKeysHolder {
pub fn take(&self) -> TlsKeys {
std::mem::take(&mut *self.0.borrow_mut())
Expand Down Expand Up @@ -222,6 +224,8 @@ pub struct TlsKeyLookup {
RefCell<HashMap<String, broadcast::Sender<Result<TlsKey, ErrorType>>>>,
}

impl deno_core::GcResource for TlsKeyLookup {}

impl TlsKeyLookup {
/// Multiple `poll` calls are safe, but this method is not starvation-safe. Generally
/// only one `poll`er should be active at any time.
Expand Down