From 5a27cb7655b75ed9ee96b8b78cb35af47407c9a2 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 15 Aug 2021 15:13:08 +0200 Subject: [PATCH] Upgrade V8 to 9.4.146.2 (#753) --- README.md | 2 +- src/binding.cc | 13 ------------ src/module.rs | 54 -------------------------------------------------- v8 | 2 +- 4 files changed, 2 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 51f490c1..fc904203 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Rusty V8 Binding -V8 Version: 9.3.345.11 +V8 Version: 9.4.146.2 [![ci](https://github.com/denoland/rusty_v8/workflows/ci/badge.svg?branch=main)](https://github.com/denoland/rusty_v8/actions) [![crates](https://img.shields.io/crates/v/rusty_v8.svg)](https://crates.io/crates/rusty_v8) diff --git a/src/binding.cc b/src/binding.cc index bf85f5d5..b0da6fe6 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -2298,23 +2298,10 @@ const v8::Value* v8__Module__GetException(const v8::Module& self) { return local_to_ptr(self.GetException()); } -int v8__Module__GetModuleRequestsLength(const v8::Module& self) { - return self.GetModuleRequestsLength(); -} - -const v8::String* v8__Module__GetModuleRequest(const v8::Module& self, int i) { - return local_to_ptr(self.GetModuleRequest(i)); -} - const v8::FixedArray* v8__Module__GetModuleRequests(const v8::Module& self) { return local_to_ptr(self.GetModuleRequests()); } -void v8__Module__GetModuleRequestLocation(const v8::Module& self, int i, - v8::Location* out) { - *out = self.GetModuleRequestLocation(i); -} - void v8__Module__SourceOffsetToLocation(const v8::Module& self, int offset, v8::Location* out) { *out = self.SourceOffsetToLocation(offset); diff --git a/src/module.rs b/src/module.rs index 7d68386c..e0fb0a3c 100644 --- a/src/module.rs +++ b/src/module.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::hash::Hash; use std::hash::Hasher; use std::mem::MaybeUninit; @@ -137,15 +136,7 @@ where extern "C" { fn v8__Module__GetStatus(this: *const Module) -> ModuleStatus; fn v8__Module__GetException(this: *const Module) -> *const Value; - fn v8__Module__GetModuleRequestsLength(this: *const Module) -> int; - fn v8__Module__GetModuleRequest(this: *const Module, i: int) - -> *const String; fn v8__Module__GetModuleRequests(this: *const Module) -> *const FixedArray; - fn v8__Module__GetModuleRequestLocation( - this: *const Module, - i: int, - out: *mut MaybeUninit, - ) -> Location; fn v8__Module__SourceOffsetToLocation( this: *const Module, offset: int, @@ -236,56 +227,11 @@ impl Module { unsafe { Local::from_raw(v8__Module__GetException(self)) }.unwrap() } - /// Returns the number of modules requested by this module. - #[deprecated( - since = "0.18.2", - note = "Use Module::get_module_requests() and FixedArray::length()." - )] - pub fn get_module_requests_length(&self) -> usize { - unsafe { v8__Module__GetModuleRequestsLength(self) } - .try_into() - .unwrap() - } - - /// Returns the ith module specifier in this module. - /// i must be < self.get_module_requests_length() and >= 0. - #[deprecated( - since = "0.18.2", - note = "Use Module::get_module_requests() and ModuleRequest::get_specifier()." - )] - pub fn get_module_request(&self, i: usize) -> Local { - // Note: the returned value is not actually stored in a HandleScope, - // therefore we don't need a scope object here. - unsafe { - Local::from_raw(v8__Module__GetModuleRequest(self, i.try_into().unwrap())) - } - .unwrap() - } - /// Returns the ModuleRequests for this module. pub fn get_module_requests(&self) -> Local { unsafe { Local::from_raw(v8__Module__GetModuleRequests(self)) }.unwrap() } - /// Returns the source location (line number and column number) of the ith - /// module specifier's first occurrence in this module. - #[deprecated( - since = "0.18.2", - note = "Use Module::get_module_requests(), ModuleRequest::get_source_offset() and - Module::source_offset_to_location()." - )] - pub fn get_module_request_location(&self, i: usize) -> Location { - let mut out = MaybeUninit::::uninit(); - unsafe { - v8__Module__GetModuleRequestLocation( - self, - i.try_into().unwrap(), - &mut out, - ); - out.assume_init() - } - } - /// For the given source text offset in this module, returns the corresponding /// Location with line and column numbers. pub fn source_offset_to_location(&self, offset: int) -> Location { diff --git a/v8 b/v8 index 6556d168..cd7c1dc1 160000 --- a/v8 +++ b/v8 @@ -1 +1 @@ -Subproject commit 6556d168cee1a542bed3267572862e26e0692626 +Subproject commit cd7c1dc128dd6f2b49340606cca2cab163d5849a