mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-21 15:04:33 -05:00
chore: update to Rust 1.70.0 (#1277)
This commit is contained in:
parent
4110d1bf4e
commit
4dd8b60bf0
13 changed files with 46 additions and 50 deletions
|
@ -320,9 +320,9 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Utility function that extracts the http request object from a wrapper object.
|
/// Utility function that extracts the http request object from a wrapper object.
|
||||||
fn unwrap_request<'a>(
|
fn unwrap_request(
|
||||||
scope: &mut v8::HandleScope,
|
scope: &mut v8::HandleScope,
|
||||||
request: v8::Local<'a, v8::Object>,
|
request: v8::Local<v8::Object>,
|
||||||
) -> *mut Box<dyn HttpRequest> {
|
) -> *mut Box<dyn HttpRequest> {
|
||||||
let external = request.get_internal_field(scope, 0).unwrap();
|
let external = request.get_internal_field(scope, 0).unwrap();
|
||||||
let external = unsafe { v8::Local::<v8::External>::cast(external) };
|
let external = unsafe { v8::Local::<v8::External>::cast(external) };
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.66.0"
|
channel = "1.70.0"
|
||||||
components = ["rustfmt", "clippy"]
|
components = ["rustfmt", "clippy"]
|
||||||
|
|
|
@ -567,9 +567,9 @@ impl Object {
|
||||||
// Note: This function converts the key to a name, which possibly calls back
|
// Note: This function converts the key to a name, which possibly calls back
|
||||||
// into JavaScript.
|
// into JavaScript.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn has<'s>(
|
pub fn has(
|
||||||
&self,
|
&self,
|
||||||
scope: &mut HandleScope<'s>,
|
scope: &mut HandleScope,
|
||||||
key: Local<Value>,
|
key: Local<Value>,
|
||||||
) -> Option<bool> {
|
) -> Option<bool> {
|
||||||
unsafe { v8__Object__Has(self, &*scope.get_current_context(), &*key) }
|
unsafe { v8__Object__Has(self, &*scope.get_current_context(), &*key) }
|
||||||
|
@ -577,20 +577,16 @@ impl Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn has_index<'s>(
|
pub fn has_index(&self, scope: &mut HandleScope, index: u32) -> Option<bool> {
|
||||||
&self,
|
|
||||||
scope: &mut HandleScope<'s>,
|
|
||||||
index: u32,
|
|
||||||
) -> Option<bool> {
|
|
||||||
unsafe { v8__Object__HasIndex(self, &*scope.get_current_context(), index) }
|
unsafe { v8__Object__HasIndex(self, &*scope.get_current_context(), index) }
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// HasOwnProperty() is like JavaScript's Object.prototype.hasOwnProperty().
|
/// HasOwnProperty() is like JavaScript's Object.prototype.hasOwnProperty().
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn has_own_property<'s>(
|
pub fn has_own_property(
|
||||||
&self,
|
&self,
|
||||||
scope: &mut HandleScope<'s>,
|
scope: &mut HandleScope,
|
||||||
key: Local<Name>,
|
key: Local<Name>,
|
||||||
) -> Option<bool> {
|
) -> Option<bool> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -600,18 +596,18 @@ impl Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn delete<'s>(
|
pub fn delete(
|
||||||
&self,
|
&self,
|
||||||
scope: &mut HandleScope<'s>,
|
scope: &mut HandleScope,
|
||||||
key: Local<Value>,
|
key: Local<Value>,
|
||||||
) -> Option<bool> {
|
) -> Option<bool> {
|
||||||
unsafe { v8__Object__Delete(self, &*scope.get_current_context(), &*key) }
|
unsafe { v8__Object__Delete(self, &*scope.get_current_context(), &*key) }
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn delete_index<'s>(
|
pub fn delete_index(
|
||||||
&self,
|
&self,
|
||||||
scope: &mut HandleScope<'s>,
|
scope: &mut HandleScope,
|
||||||
index: u32,
|
index: u32,
|
||||||
) -> Option<bool> {
|
) -> Option<bool> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -724,9 +720,9 @@ impl Object {
|
||||||
/// Note: Private properties are not inherited. Do not rely on this, since it
|
/// Note: Private properties are not inherited. Do not rely on this, since it
|
||||||
/// may change.
|
/// may change.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn set_private<'s>(
|
pub fn set_private(
|
||||||
&self,
|
&self,
|
||||||
scope: &mut HandleScope<'s>,
|
scope: &mut HandleScope,
|
||||||
key: Local<Private>,
|
key: Local<Private>,
|
||||||
value: Local<Value>,
|
value: Local<Value>,
|
||||||
) -> Option<bool> {
|
) -> Option<bool> {
|
||||||
|
@ -746,9 +742,9 @@ impl Object {
|
||||||
/// Note: Private properties are not inherited. Do not rely on this, since it
|
/// Note: Private properties are not inherited. Do not rely on this, since it
|
||||||
/// may change.
|
/// may change.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn delete_private<'s>(
|
pub fn delete_private(
|
||||||
&self,
|
&self,
|
||||||
scope: &mut HandleScope<'s>,
|
scope: &mut HandleScope,
|
||||||
key: Local<Private>,
|
key: Local<Private>,
|
||||||
) -> Option<bool> {
|
) -> Option<bool> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -762,9 +758,9 @@ impl Object {
|
||||||
/// Note: Private properties are not inherited. Do not rely on this, since it
|
/// Note: Private properties are not inherited. Do not rely on this, since it
|
||||||
/// may change.
|
/// may change.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn has_private<'s>(
|
pub fn has_private(
|
||||||
&self,
|
&self,
|
||||||
scope: &mut HandleScope<'s>,
|
scope: &mut HandleScope,
|
||||||
key: Local<Private>,
|
key: Local<Private>,
|
||||||
) -> Option<bool> {
|
) -> Option<bool> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -48,9 +48,9 @@ impl PrimitiveArray {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn set<'s>(
|
pub fn set(
|
||||||
&self,
|
&self,
|
||||||
scope: &mut HandleScope<'s>,
|
scope: &mut HandleScope,
|
||||||
index: usize,
|
index: usize,
|
||||||
item: Local<'_, Primitive>,
|
item: Local<'_, Primitive>,
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -91,18 +91,13 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Default)]
|
||||||
pub enum NewStringType {
|
pub enum NewStringType {
|
||||||
|
#[default]
|
||||||
Normal,
|
Normal,
|
||||||
Internalized,
|
Internalized,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for NewStringType {
|
|
||||||
fn default() -> Self {
|
|
||||||
NewStringType::Normal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
|
|
18
src/value.rs
18
src/value.rs
|
@ -568,9 +568,9 @@ impl Value {
|
||||||
|
|
||||||
/// Convenience function not present in the original V8 API.
|
/// Convenience function not present in the original V8 API.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn to_rust_string_lossy<'s>(
|
pub fn to_rust_string_lossy(
|
||||||
&self,
|
&self,
|
||||||
scope: &mut HandleScope<'s>,
|
scope: &mut HandleScope,
|
||||||
) -> std::string::String {
|
) -> std::string::String {
|
||||||
self
|
self
|
||||||
.to_string(scope)
|
.to_string(scope)
|
||||||
|
@ -646,9 +646,9 @@ impl Value {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn instance_of<'s>(
|
pub fn instance_of(
|
||||||
&self,
|
&self,
|
||||||
scope: &mut HandleScope<'s>,
|
scope: &mut HandleScope,
|
||||||
object: Local<Object>,
|
object: Local<Object>,
|
||||||
) -> Option<bool> {
|
) -> Option<bool> {
|
||||||
let mut out = Maybe::<bool>::default();
|
let mut out = Maybe::<bool>::default();
|
||||||
|
@ -664,7 +664,7 @@ impl Value {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn number_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<f64> {
|
pub fn number_value(&self, scope: &mut HandleScope) -> Option<f64> {
|
||||||
let mut out = Maybe::<f64>::default();
|
let mut out = Maybe::<f64>::default();
|
||||||
unsafe {
|
unsafe {
|
||||||
v8__Value__NumberValue(self, &*scope.get_current_context(), &mut out)
|
v8__Value__NumberValue(self, &*scope.get_current_context(), &mut out)
|
||||||
|
@ -673,7 +673,7 @@ impl Value {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn integer_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<i64> {
|
pub fn integer_value(&self, scope: &mut HandleScope) -> Option<i64> {
|
||||||
let mut out = Maybe::<i64>::default();
|
let mut out = Maybe::<i64>::default();
|
||||||
unsafe {
|
unsafe {
|
||||||
v8__Value__IntegerValue(self, &*scope.get_current_context(), &mut out)
|
v8__Value__IntegerValue(self, &*scope.get_current_context(), &mut out)
|
||||||
|
@ -682,7 +682,7 @@ impl Value {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn uint32_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<u32> {
|
pub fn uint32_value(&self, scope: &mut HandleScope) -> Option<u32> {
|
||||||
let mut out = Maybe::<u32>::default();
|
let mut out = Maybe::<u32>::default();
|
||||||
unsafe {
|
unsafe {
|
||||||
v8__Value__Uint32Value(self, &*scope.get_current_context(), &mut out)
|
v8__Value__Uint32Value(self, &*scope.get_current_context(), &mut out)
|
||||||
|
@ -691,7 +691,7 @@ impl Value {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn int32_value<'s>(&self, scope: &mut HandleScope<'s>) -> Option<i32> {
|
pub fn int32_value(&self, scope: &mut HandleScope) -> Option<i32> {
|
||||||
let mut out = Maybe::<i32>::default();
|
let mut out = Maybe::<i32>::default();
|
||||||
unsafe {
|
unsafe {
|
||||||
v8__Value__Int32Value(self, &*scope.get_current_context(), &mut out)
|
v8__Value__Int32Value(self, &*scope.get_current_context(), &mut out)
|
||||||
|
@ -700,7 +700,7 @@ impl Value {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn boolean_value<'s>(&self, scope: &mut HandleScope<'s, ()>) -> bool {
|
pub fn boolean_value(&self, scope: &mut HandleScope<'_, ()>) -> bool {
|
||||||
unsafe { v8__Value__BooleanValue(self, scope.get_isolate_ptr()) }
|
unsafe { v8__Value__BooleanValue(self, scope.get_isolate_ptr()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
error[E0597]: `scope2` does not live long enough
|
error[E0597]: `scope2` does not live long enough
|
||||||
--> $DIR/boxed_local.rs:9:43
|
--> tests/compile_fail/boxed_local.rs:9:43
|
||||||
|
|
|
|
||||||
7 | let _boxed_local = {
|
7 | let _boxed_local = {
|
||||||
| ------------ borrow later stored here
|
| ------------ borrow later stored here
|
||||||
8 | let mut scope2 = v8::HandleScope::new(&mut scope1);
|
8 | let mut scope2 = v8::HandleScope::new(&mut scope1);
|
||||||
|
| ---------- binding `scope2` declared here
|
||||||
9 | let mut scope3 = v8::HandleScope::new(&mut scope2);
|
9 | let mut scope3 = v8::HandleScope::new(&mut scope2);
|
||||||
| ^^^^^^^^^^^ borrowed value does not live long enough
|
| ^^^^^^^^^^^ borrowed value does not live long enough
|
||||||
10 | Box::new(v8::Integer::new(&mut scope3, 123))
|
10 | Box::new(v8::Integer::new(&mut scope3, 123))
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
error[E0597]: `scope2` does not live long enough
|
error[E0597]: `scope2` does not live long enough
|
||||||
--> $DIR/handle_scope_escape_lifetime.rs:9:43
|
--> tests/compile_fail/handle_scope_escape_lifetime.rs:9:43
|
||||||
|
|
|
|
||||||
7 | let _local = {
|
7 | let _local = {
|
||||||
| ------ borrow later stored here
|
| ------ borrow later stored here
|
||||||
8 | let mut scope2 = v8::HandleScope::new(&mut scope1);
|
8 | let mut scope2 = v8::HandleScope::new(&mut scope1);
|
||||||
|
| ---------- binding `scope2` declared here
|
||||||
9 | let mut scope3 = v8::HandleScope::new(&mut scope2);
|
9 | let mut scope3 = v8::HandleScope::new(&mut scope2);
|
||||||
| ^^^^^^^^^^^ borrowed value does not live long enough
|
| ^^^^^^^^^^^ borrowed value does not live long enough
|
||||||
...
|
...
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
error[E0597]: `scope2` does not live long enough
|
error[E0597]: `scope2` does not live long enough
|
||||||
--> $DIR/handle_scope_lifetime_4.rs:9:35
|
--> tests/compile_fail/handle_scope_lifetime_4.rs:9:35
|
||||||
|
|
|
|
||||||
7 | let mut _scope3 = {
|
7 | let mut _scope3 = {
|
||||||
| ----------- borrow later stored here
|
| ----------- borrow later stored here
|
||||||
8 | let mut scope2 = v8::HandleScope::new(&mut scope1);
|
8 | let mut scope2 = v8::HandleScope::new(&mut scope1);
|
||||||
|
| ---------- binding `scope2` declared here
|
||||||
9 | v8::EscapableHandleScope::new(&mut scope2)
|
9 | v8::EscapableHandleScope::new(&mut scope2)
|
||||||
| ^^^^^^^^^^^ borrowed value does not live long enough
|
| ^^^^^^^^^^^ borrowed value does not live long enough
|
||||||
10 | };
|
10 | };
|
||||||
|
|
|
@ -2,7 +2,7 @@ error[E0308]: mismatched types
|
||||||
--> tests/compile_fail/object_without_context_scope.rs:6:33
|
--> tests/compile_fail/object_without_context_scope.rs:6:33
|
||||||
|
|
|
|
||||||
6 | let _object = v8::Object::new(&mut scope);
|
6 | let _object = v8::Object::new(&mut scope);
|
||||||
| --------------- ^^^^^^^^^^ expected struct `v8::Context`, found `()`
|
| --------------- ^^^^^^^^^^ expected `&mut HandleScope<'_>`, found `&mut HandleScope<'_, ()>`
|
||||||
| |
|
| |
|
||||||
| arguments to this function are incorrect
|
| arguments to this function are incorrect
|
||||||
|
|
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
error[E0597]: `scope3` does not live long enough
|
error[E0597]: `scope3` does not live long enough
|
||||||
--> $DIR/try_catch_exception_lifetime.rs:11:43
|
--> tests/compile_fail/try_catch_exception_lifetime.rs:11:43
|
||||||
|
|
|
|
||||||
9 | let _exception = {
|
9 | let _exception = {
|
||||||
| ---------- borrow later stored here
|
| ---------- borrow later stored here
|
||||||
10 | let mut scope3 = v8::HandleScope::new(&mut scope2);
|
10 | let mut scope3 = v8::HandleScope::new(&mut scope2);
|
||||||
|
| ---------- binding `scope3` declared here
|
||||||
11 | let mut scope4 = v8::HandleScope::new(&mut scope3);
|
11 | let mut scope4 = v8::HandleScope::new(&mut scope3);
|
||||||
| ^^^^^^^^^^^ borrowed value does not live long enough
|
| ^^^^^^^^^^^ borrowed value does not live long enough
|
||||||
...
|
...
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
error[E0597]: `scope3` does not live long enough
|
error[E0597]: `scope3` does not live long enough
|
||||||
--> $DIR/try_catch_message_lifetime.rs:11:43
|
--> tests/compile_fail/try_catch_message_lifetime.rs:11:43
|
||||||
|
|
|
|
||||||
9 | let _message = {
|
9 | let _message = {
|
||||||
| -------- borrow later stored here
|
| -------- borrow later stored here
|
||||||
10 | let mut scope3 = v8::HandleScope::new(&mut scope2);
|
10 | let mut scope3 = v8::HandleScope::new(&mut scope2);
|
||||||
|
| ---------- binding `scope3` declared here
|
||||||
11 | let mut scope4 = v8::HandleScope::new(&mut scope3);
|
11 | let mut scope4 = v8::HandleScope::new(&mut scope3);
|
||||||
| ^^^^^^^^^^^ borrowed value does not live long enough
|
| ^^^^^^^^^^^ borrowed value does not live long enough
|
||||||
...
|
...
|
||||||
|
|
|
@ -679,8 +679,8 @@ fn get_isolate_from_handle() {
|
||||||
check_handle_helper(scope, expect_some, local2);
|
check_handle_helper(scope, expect_some, local2);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_eval<'s>(
|
fn check_eval(
|
||||||
scope: &mut v8::HandleScope<'s>,
|
scope: &mut v8::HandleScope,
|
||||||
expect_some: Option<bool>,
|
expect_some: Option<bool>,
|
||||||
code: &str,
|
code: &str,
|
||||||
) {
|
) {
|
||||||
|
@ -4482,8 +4482,8 @@ fn mock_script_origin<'s>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mock_source<'s>(
|
fn mock_source(
|
||||||
scope: &mut v8::HandleScope<'s>,
|
scope: &mut v8::HandleScope,
|
||||||
resource_name: &str,
|
resource_name: &str,
|
||||||
source: &str,
|
source: &str,
|
||||||
) -> v8::script_compiler::Source {
|
) -> v8::script_compiler::Source {
|
||||||
|
|
Loading…
Reference in a new issue