summaryrefslogtreecommitdiff
path: root/core/runtime.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-08-18 17:35:02 +0530
committerGitHub <noreply@github.com>2022-08-18 17:35:02 +0530
commitcd21cff29942f24ba7d38287186cce64d0e84e56 (patch)
treee663eff884526ee762ae9141a3cf5a0f6967a84e /core/runtime.rs
parent0b0843e4a54d7c1ddf293ac1ccee2479b69a5ba9 (diff)
feat(ext/flash): An optimized http/1.1 server (#15405)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com> Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl> Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'core/runtime.rs')
-rw-r--r--core/runtime.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/runtime.rs b/core/runtime.rs
index 7f113223f..def38e1eb 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -250,6 +250,9 @@ fn v8_init(
v8::V8::initialize();
}
+pub const V8_WRAPPER_TYPE_INDEX: i32 = 0;
+pub const V8_WRAPPER_OBJECT_INDEX: i32 = 1;
+
#[derive(Default)]
pub struct RuntimeOptions {
/// Source map reference for errors.
@@ -360,7 +363,12 @@ impl JsRuntime {
let mut params = options
.create_params
.take()
- .unwrap_or_else(v8::Isolate::create_params)
+ .unwrap_or_else(|| {
+ v8::CreateParams::default().embedder_wrapper_type_info_offsets(
+ V8_WRAPPER_TYPE_INDEX,
+ V8_WRAPPER_OBJECT_INDEX,
+ )
+ })
.external_references(&**bindings::EXTERNAL_REFERENCES);
let snapshot_loaded = if let Some(snapshot) = options.startup_snapshot {
params = match snapshot {