Skip to content

Commit

Permalink
fix: update rusty_v8 (#886)
Browse files Browse the repository at this point in the history
includes fixes for tla bugs introduced in 12.9
  • Loading branch information
devsnek authored Aug 28, 2024
1 parent 2a56283 commit 3f15885
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ deno_ops = { version = "0.182.0", path = "./ops" }
serde_v8 = { version = "0.215.0", path = "./serde_v8" }
deno_core_testing = { path = "./testing" }

v8 = { version = "0.104.0", default-features = false }
v8 = { version = "0.105.0", default-features = false }
deno_ast = { version = "=0.40.0", features = ["transpiling"] }
deno_unsync = "0.4.0"
deno_core_icudata = "0.0.73"
Expand Down
27 changes: 13 additions & 14 deletions core/ops_builtin_v8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ struct SerializeDeserialize<'a> {
impl<'a> v8::ValueSerializerImpl for SerializeDeserialize<'a> {
#[allow(unused_variables)]
fn throw_data_clone_error<'s>(
&mut self,
&self,
scope: &mut v8::HandleScope<'s>,
message: v8::Local<'s, v8::String>,
) {
Expand All @@ -446,7 +446,7 @@ impl<'a> v8::ValueSerializerImpl for SerializeDeserialize<'a> {
}

fn get_shared_array_buffer_id<'s>(
&mut self,
&self,
scope: &mut v8::HandleScope<'s>,
shared_array_buffer: v8::Local<'s, v8::SharedArrayBuffer>,
) -> Option<u32> {
Expand All @@ -464,7 +464,7 @@ impl<'a> v8::ValueSerializerImpl for SerializeDeserialize<'a> {
}

fn get_wasm_module_transfer_id(
&mut self,
&self,
scope: &mut v8::HandleScope<'_>,
module: v8::Local<v8::WasmModuleObject>,
) -> Option<u32> {
Expand All @@ -484,12 +484,12 @@ impl<'a> v8::ValueSerializerImpl for SerializeDeserialize<'a> {
}
}

fn has_custom_host_object(&mut self, _isolate: &mut v8::Isolate) -> bool {
fn has_custom_host_object(&self, _isolate: &mut v8::Isolate) -> bool {
true
}

fn is_host_object<'s>(
&mut self,
&self,
scope: &mut v8::HandleScope<'s>,
object: v8::Local<'s, v8::Object>,
) -> Option<bool> {
Expand All @@ -502,10 +502,10 @@ impl<'a> v8::ValueSerializerImpl for SerializeDeserialize<'a> {
}

fn write_host_object<'s>(
&mut self,
&self,
scope: &mut v8::HandleScope<'s>,
object: v8::Local<'s, v8::Object>,
value_serializer: &mut dyn v8::ValueSerializerHelper,
value_serializer: &dyn v8::ValueSerializerHelper,
) -> Option<bool> {
if let Some(host_objects) = self.host_objects {
for i in 0..host_objects.length() {
Expand All @@ -524,7 +524,7 @@ impl<'a> v8::ValueSerializerImpl for SerializeDeserialize<'a> {

impl<'a> v8::ValueDeserializerImpl for SerializeDeserialize<'a> {
fn get_shared_array_buffer_from_id<'s>(
&mut self,
&self,
scope: &mut v8::HandleScope<'s>,
transfer_id: u32,
) -> Option<v8::Local<'s, v8::SharedArrayBuffer>> {
Expand All @@ -543,7 +543,7 @@ impl<'a> v8::ValueDeserializerImpl for SerializeDeserialize<'a> {
}

fn get_wasm_module_from_id<'s>(
&mut self,
&self,
scope: &mut v8::HandleScope<'s>,
clone_id: u32,
) -> Option<v8::Local<'s, v8::WasmModuleObject>> {
Expand All @@ -561,9 +561,9 @@ impl<'a> v8::ValueDeserializerImpl for SerializeDeserialize<'a> {
}

fn read_host_object<'s>(
&mut self,
&self,
scope: &mut v8::HandleScope<'s>,
value_deserializer: &mut dyn v8::ValueDeserializerHelper,
value_deserializer: &dyn v8::ValueDeserializerHelper,
) -> Option<v8::Local<'s, v8::Object>> {
if let Some(host_objects) = self.host_objects {
let mut i = 0;
Expand Down Expand Up @@ -627,8 +627,7 @@ pub fn op_serialize(
for_storage,
host_object_brand,
});
let mut value_serializer =
v8::ValueSerializer::new(scope, serialize_deserialize);
let value_serializer = v8::ValueSerializer::new(scope, serialize_deserialize);
value_serializer.write_header();

if let Some(transferred_array_buffers) = transferred_array_buffers {
Expand Down Expand Up @@ -707,7 +706,7 @@ pub fn op_deserialize<'a>(
for_storage,
host_object_brand: None,
});
let mut value_deserializer =
let value_deserializer =
v8::ValueDeserializer::new(scope, serialize_deserialize, &zero_copy);
let parsed_header = value_deserializer
.read_header(scope.get_current_context())
Expand Down

0 comments on commit 3f15885

Please sign in to comment.