From 66fd6f286641d4d2491d7b4bb314bd7e7eff16d8 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Wed, 13 Mar 2024 21:23:37 -0600 Subject: fix(cli): unbreak extension example and fix __runtime_js_sources (#22906) Better example to close https://github.com/denoland/deno/issues/22600 --------- Signed-off-by: Matt Mastracci --- runtime/ops/bootstrap.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'runtime/ops') diff --git a/runtime/ops/bootstrap.rs b/runtime/ops/bootstrap.rs index 7de532a9f..cbb87db88 100644 --- a/runtime/ops/bootstrap.rs +++ b/runtime/ops/bootstrap.rs @@ -30,7 +30,7 @@ deno_core::extension!( }, ); -#[derive(Serialize, Default)] +#[derive(Serialize)] #[serde(rename_all = "camelCase")] pub struct SnapshotOptions { pub deno_version: String, @@ -39,6 +39,17 @@ pub struct SnapshotOptions { pub target: String, } +impl Default for SnapshotOptions { + fn default() -> Self { + Self { + deno_version: "dev".to_owned(), + ts_version: "n/a".to_owned(), + v8_version: deno_core::v8_version(), + target: std::env::consts::ARCH.to_owned(), + } + } +} + // Note: Called at snapshot time, op perf is not a concern. #[op2] #[serde] -- cgit v1.2.3