diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-05-08 21:37:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 19:37:29 +0000 |
commit | e021070a2a564b2e972851360265f2466f7e4b22 (patch) | |
tree | dfb9c4861c4ad082d8dd6695502491d52b9d2913 | |
parent | 71db518b7625acb106d93643619f648aed8222cc (diff) |
refactor(core): make sure to always set embedder wrapper offset (#19048)
-rw-r--r-- | core/runtime.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/runtime.rs b/core/runtime.rs index bd79ca6cc..3c2e6f3e1 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -396,12 +396,11 @@ impl JsRuntime { let mut params = options .create_params .take() - .unwrap_or_else(|| { - v8::CreateParams::default().embedder_wrapper_type_info_offsets( - V8_WRAPPER_TYPE_INDEX, - V8_WRAPPER_OBJECT_INDEX, - ) - }) + .unwrap_or_default() + .embedder_wrapper_type_info_offsets( + V8_WRAPPER_TYPE_INDEX, + V8_WRAPPER_OBJECT_INDEX, + ) .external_references(&**refs); if let Some(snapshot) = options.startup_snapshot { |