Skip to content

Commit a1a26ca

Browse files
Merge branch 'main' into f_cache_env_file
2 parents 3db02e5 + 730f48b commit a1a26ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+521
-113
lines changed

Cargo.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ repository = "https://github.com/denoland/deno"
5454

5555
[workspace.dependencies]
5656
deno_ast = { version = "=0.46.6", features = ["transpiling"] }
57-
deno_core = { version = "0.345.0" }
57+
deno_core = { version = "0.346.0" }
5858

5959
deno_cache_dir = "=0.20.0"
6060
deno_config = { version = "=0.54.2", features = ["workspace"] }
@@ -296,8 +296,8 @@ env_logger = "=0.11.6"
296296
eszip = "=0.87.0"
297297
fancy-regex = "=0.14.0"
298298
libsui = "0.10.0"
299-
malva = "=0.11.2"
300-
markup_fmt = "=0.19.1"
299+
malva = "=0.12.0"
300+
markup_fmt = "=0.20.0"
301301
open = "5.0.1"
302302
pathdiff = "0.2.1"
303303
pretty_yaml = "=0.5.0"

cli/lsp/tsc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5861,7 +5861,7 @@ mod tests {
58615861
rx,
58625862
Arc::new(AtomicBool::new(true)),
58635863
);
5864-
let mut op_state = OpState::new(None, None);
5864+
let mut op_state = OpState::new(None);
58655865
op_state.put(state);
58665866
op_state
58675867
}

cli/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,14 @@ fn setup_panic_hook() {
410410
orig_hook(panic_info);
411411
deno_runtime::exit(1);
412412
}));
413+
414+
fn error_handler(file: &str, line: i32, message: &str) {
415+
// Override C++ abort with a rust panic, so we
416+
// get our message above and a nice backtrace.
417+
panic!("Fatal error in {file}:{line}: {message}");
418+
}
419+
420+
deno_core::v8::V8::set_fatal_error_handler(error_handler);
413421
}
414422

415423
fn exit_with_message(message: &str, code: i32) -> ! {

cli/tools/fmt.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,8 @@ fn format_embedded_css(
618618
selector_override_comment_directive: "malva-selector-override".into(),
619619
ignore_comment_directive: "malva-ignore".into(),
620620
ignore_file_comment_directive: "malva-ignore-file".into(),
621+
declaration_order_group_by:
622+
config::DeclarationOrderGroupBy::NonDeclarationAndEmptyLine,
621623
},
622624
};
623625
// Wraps the text in a css block of `a { ... }`
@@ -711,6 +713,7 @@ fn format_embedded_html(
711713
script_formatter: None,
712714
ignore_comment_directive: "deno-fmt-ignore".into(),
713715
ignore_file_comment_directive: "deno-fmt-ignore-file".into(),
716+
single_attr_same_line: true,
714717
},
715718
};
716719
let Ok(text) = markup_fmt::format_text(
@@ -1463,6 +1466,8 @@ fn get_resolved_malva_config(
14631466
selector_override_comment_directive: "deno-fmt-selector-override".into(),
14641467
ignore_comment_directive: "deno-fmt-ignore".into(),
14651468
ignore_file_comment_directive: "deno-fmt-ignore-file".into(),
1469+
declaration_order_group_by:
1470+
DeclarationOrderGroupBy::NonDeclarationAndEmptyLine,
14661471
};
14671472

14681473
FormatOptions {
@@ -1523,6 +1528,7 @@ fn get_resolved_markup_fmt_config(
15231528
astro_attr_shorthand: Some(true),
15241529
ignore_comment_directive: "deno-fmt-ignore".into(),
15251530
ignore_file_comment_directive: "deno-fmt-ignore-file".into(),
1531+
single_attr_same_line: true,
15261532
};
15271533

15281534
FormatOptions {

cli/tsc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ mod tests {
15371537
.context("Unable to get CWD")
15381538
.unwrap(),
15391539
);
1540-
let mut op_state = OpState::new(None, None);
1540+
let mut op_state = OpState::new(None);
15411541
op_state.put(state);
15421542
op_state
15431543
}

ext/ffi/dlfcn.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,11 @@ struct FunctionData {
262262
turbocall: Option<Turbocall>,
263263
}
264264

265-
impl GarbageCollected for FunctionData {}
265+
impl GarbageCollected for FunctionData {
266+
fn get_name(&self) -> &'static std::ffi::CStr {
267+
c"FunctionData"
268+
}
269+
}
266270

267271
// Create a JavaScript function for synchronous FFI call to
268272
// the given symbol.

ext/net/02_tls.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ async function startTls(
187187
hostname,
188188
caCerts,
189189
alpnProtocols,
190-
});
190+
}, null);
191191
return new TlsConn(rid, remoteAddr, localAddr);
192192
}
193193

ext/net/ops.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ pub struct NetPermToken {
399399
pub resolved_ips: Vec<String>,
400400
}
401401

402-
impl deno_core::GarbageCollected for NetPermToken {}
402+
impl deno_core::GarbageCollected for NetPermToken {
403+
fn get_name(&self) -> &'static std::ffi::CStr {
404+
c"NetPermToken"
405+
}
406+
}
403407

404408
impl NetPermToken {
405409
/// Checks if the given address is included in the resolved IPs.

ext/net/ops_tls.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ pub fn op_tls_key_null() -> TlsKeysHolder {
196196
TlsKeysHolder::from(TlsKeys::Null)
197197
}
198198

199-
#[op2]
199+
#[op2(reentrant)]
200200
#[cppgc]
201201
pub fn op_tls_key_static(
202202
#[string] cert: &str,
@@ -258,6 +258,7 @@ pub fn op_tls_cert_resolver_resolve_error(
258258
pub fn op_tls_start<NP>(
259259
state: Rc<RefCell<OpState>>,
260260
#[serde] args: StartTlsArgs,
261+
#[cppgc] key_pair: Option<&TlsKeysHolder>,
261262
) -> Result<(ResourceId, IpAddr, IpAddr), NetError>
262263
where
263264
NP: NetPermissions + 'static,
@@ -304,11 +305,13 @@ where
304305
let local_addr = tcp_stream.local_addr()?;
305306
let remote_addr = tcp_stream.peer_addr()?;
306307

308+
let tls_null = TlsKeysHolder::from(TlsKeys::Null);
309+
let key_pair = key_pair.unwrap_or(&tls_null);
307310
let mut tls_config = create_client_config(
308311
root_cert_store,
309312
ca_certs,
310313
unsafely_ignore_certificate_errors,
311-
TlsKeys::Null,
314+
key_pair.take(),
312315
SocketUse::GeneralSsl,
313316
)?;
314317

ext/net/quic.rs

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ struct EndpointResource {
213213
session_store: Arc<dyn ClientSessionStore>,
214214
}
215215

216-
impl GarbageCollected for EndpointResource {}
216+
impl GarbageCollected for EndpointResource {
217+
fn get_name(&self) -> &'static std::ffi::CStr {
218+
c"EndpointResource"
219+
}
220+
}
217221

218222
#[op2]
219223
#[cppgc]
@@ -294,7 +298,11 @@ impl Drop for ListenerResource {
294298
}
295299
}
296300

297-
impl GarbageCollected for ListenerResource {}
301+
impl GarbageCollected for ListenerResource {
302+
fn get_name(&self) -> &'static std::ffi::CStr {
303+
c"ListenerResource"
304+
}
305+
}
298306

299307
#[op2]
300308
#[cppgc]
@@ -345,14 +353,22 @@ struct ConnectionResource(
345353
RefCell<Option<quinn::ZeroRttAccepted>>,
346354
);
347355

348-
impl GarbageCollected for ConnectionResource {}
356+
impl GarbageCollected for ConnectionResource {
357+
fn get_name(&self) -> &'static std::ffi::CStr {
358+
c"ConnectionResource"
359+
}
360+
}
349361

350362
struct IncomingResource(
351363
RefCell<Option<quinn::Incoming>>,
352364
Arc<QuicServerConfig>,
353365
);
354366

355-
impl GarbageCollected for IncomingResource {}
367+
impl GarbageCollected for IncomingResource {
368+
fn get_name(&self) -> &'static std::ffi::CStr {
369+
c"IncomingResource"
370+
}
371+
}
356372

357373
#[op2(async)]
358374
#[cppgc]
@@ -481,7 +497,11 @@ pub(crate) fn op_quic_incoming_ignore(
481497

482498
struct ConnectingResource(RefCell<Option<quinn::Connecting>>);
483499

484-
impl GarbageCollected for ConnectingResource {}
500+
impl GarbageCollected for ConnectingResource {
501+
fn get_name(&self) -> &'static std::ffi::CStr {
502+
c"ConnectingResource"
503+
}
504+
}
485505

486506
#[derive(Deserialize)]
487507
#[serde(rename_all = "camelCase")]

ext/node/global.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Copyright 2018-2025 the Deno authors. MIT license.
22

3+
use std::rc::Rc;
4+
35
use deno_core::v8;
46
use deno_core::v8::GetPropertyNamesArgs;
57
use deno_core::v8::MapFnTo;
@@ -11,13 +13,13 @@ use deno_core::v8::MapFnTo;
1113
// these mapped functions per-thread. We should revisit it in the future and
1214
// ideally remove altogether.
1315
thread_local! {
14-
pub static GETTER_MAP_FN: v8::NamedPropertyGetterCallback<'static> = getter.map_fn_to();
15-
pub static SETTER_MAP_FN: v8::NamedPropertySetterCallback<'static> = setter.map_fn_to();
16-
pub static QUERY_MAP_FN: v8::NamedPropertyQueryCallback<'static> = query.map_fn_to();
17-
pub static DELETER_MAP_FN: v8::NamedPropertyDeleterCallback<'static> = deleter.map_fn_to();
18-
pub static ENUMERATOR_MAP_FN: v8::NamedPropertyEnumeratorCallback<'static> = enumerator.map_fn_to();
19-
pub static DEFINER_MAP_FN: v8::NamedPropertyDefinerCallback<'static> = definer.map_fn_to();
20-
pub static DESCRIPTOR_MAP_FN: v8::NamedPropertyGetterCallback<'static> = descriptor.map_fn_to();
16+
pub static GETTER_MAP_FN: v8::NamedPropertyGetterCallback = getter.map_fn_to();
17+
pub static SETTER_MAP_FN: v8::NamedPropertySetterCallback = setter.map_fn_to();
18+
pub static QUERY_MAP_FN: v8::NamedPropertyQueryCallback = query.map_fn_to();
19+
pub static DELETER_MAP_FN: v8::NamedPropertyDeleterCallback = deleter.map_fn_to();
20+
pub static ENUMERATOR_MAP_FN: v8::NamedPropertyEnumeratorCallback = enumerator.map_fn_to();
21+
pub static DEFINER_MAP_FN: v8::NamedPropertyDefinerCallback = definer.map_fn_to();
22+
pub static DESCRIPTOR_MAP_FN: v8::NamedPropertyGetterCallback = descriptor.map_fn_to();
2123
}
2224

2325
/// Convert an ASCII string to a UTF-16 byte encoding of the string.
@@ -224,7 +226,7 @@ pub fn global_object_middleware<'s>(
224226
deno_globals,
225227
node_globals,
226228
};
227-
scope.get_current_context().set_slot(storage);
229+
scope.get_current_context().set_slot(Rc::new(storage));
228230
}
229231

230232
fn is_managed_key(

ext/node/ops/blocklist.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ pub struct BlockListResource {
1818
blocklist: RefCell<BlockList>,
1919
}
2020

21-
impl deno_core::GarbageCollected for BlockListResource {}
21+
impl deno_core::GarbageCollected for BlockListResource {
22+
fn get_name(&self) -> &'static std::ffi::CStr {
23+
c"BlockListResource"
24+
}
25+
}
2226

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

ext/node/ops/crypto/digest.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ pub struct Hasher {
1414
pub hash: Rc<RefCell<Option<Hash>>>,
1515
}
1616

17-
impl GarbageCollected for Hasher {}
17+
impl GarbageCollected for Hasher {
18+
fn get_name(&self) -> &'static std::ffi::CStr {
19+
c"Hasher"
20+
}
21+
}
1822

1923
impl Hasher {
2024
pub fn new(

0 commit comments

Comments
 (0)