diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-03-13 21:23:37 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-14 04:23:37 +0100 |
commit | 66fd6f286641d4d2491d7b4bb314bd7e7eff16d8 (patch) | |
tree | b84aa4cac4c0a756539c91e5df4193d3636ae2bb /runtime/ops/bootstrap.rs | |
parent | 1f3c4c976313904d5df0b33b2cc0e282e62d1000 (diff) |
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 <matthew@mastracci.com>
Diffstat (limited to 'runtime/ops/bootstrap.rs')
-rw-r--r-- | runtime/ops/bootstrap.rs | 13 |
1 files changed, 12 insertions, 1 deletions
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] |