mirror of
https://github.com/denoland/rusty_v8.git
synced 2025-01-12 17:09:28 -05:00
Narrow dead_code allowance (#818)
This commit is contained in:
parent
57a00141d7
commit
8297216a1c
8 changed files with 17 additions and 16 deletions
|
@ -397,6 +397,7 @@ impl HandleHost {
|
|||
)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn match_isolate(self, isolate: &mut Isolate) -> bool {
|
||||
self.match_host(isolate.into(), Some(isolate))
|
||||
}
|
||||
|
@ -413,6 +414,7 @@ impl HandleHost {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn get_isolate_handle(self) -> IsolateHandle {
|
||||
unsafe { self.get_isolate().as_ref() }.thread_safe_handle()
|
||||
}
|
||||
|
|
|
@ -379,12 +379,14 @@ impl Isolate {
|
|||
|
||||
/// Retrieve embedder-specific data from the isolate.
|
||||
/// Returns NULL if SetData has never been called for the given `slot`.
|
||||
#[allow(dead_code)]
|
||||
fn get_data(&self, slot: u32) -> *mut c_void {
|
||||
unsafe { v8__Isolate__GetData(self, slot + Self::INTERNAL_SLOT_COUNT) }
|
||||
}
|
||||
|
||||
/// Returns the maximum number of available embedder data slots. Valid slots
|
||||
/// are in the range of 0 - `Isolate::get_number_of_data_slots() - 1`.
|
||||
#[allow(dead_code)]
|
||||
fn get_number_of_data_slots(&self) -> u32 {
|
||||
unsafe {
|
||||
v8__Isolate__GetNumberOfDataSlots(self) - Self::INTERNAL_SLOT_COUNT
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
//! # Example
|
||||
//!
|
||||
//! ```rust
|
||||
//! //!
|
||||
//! let platform = v8::new_default_platform(0, false).make_shared();
|
||||
//! v8::V8::initialize_platform(platform);
|
||||
//! v8::V8::initialize();
|
||||
|
@ -24,13 +23,11 @@
|
|||
//! ```
|
||||
|
||||
#![allow(clippy::missing_safety_doc)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
extern crate libc;
|
||||
|
||||
mod array_buffer;
|
||||
mod array_buffer_view;
|
||||
|
|
|
@ -101,6 +101,7 @@ impl<'a> std::ops::Deref for CachedData<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(C)]
|
||||
#[derive(Debug)]
|
||||
enum BufferPolicy {
|
||||
|
|
|
@ -77,9 +77,11 @@ extern "C" {
|
|||
length: int,
|
||||
) -> *const String;
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn v8__String__IsExternal(this: *const String) -> bool;
|
||||
fn v8__String__IsExternalOneByte(this: *const String) -> bool;
|
||||
fn v8__String__IsExternalTwoByte(this: *const String) -> bool;
|
||||
#[allow(dead_code)]
|
||||
fn v8__String__IsOneByte(this: *const String) -> bool;
|
||||
fn v8__String__ContainsOnlyOneByte(this: *const String) -> bool;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ extern "C" {
|
|||
fn v8__Value__IsRegExp(this: *const Value) -> bool;
|
||||
fn v8__Value__IsAsyncFunction(this: *const Value) -> bool;
|
||||
fn v8__Value__IsGeneratorFunction(this: *const Value) -> bool;
|
||||
#[allow(dead_code)]
|
||||
fn v8__Value__IsGeneratorObject(this: *const Value) -> bool;
|
||||
fn v8__Value__IsPromise(this: *const Value) -> bool;
|
||||
fn v8__Value__IsMap(this: *const Value) -> bool;
|
||||
|
|
|
@ -150,11 +150,10 @@ extern "C" {
|
|||
/// The ValueDeserializerImpl trait allows for
|
||||
/// custom callback functions used by v8.
|
||||
pub trait ValueDeserializerImpl {
|
||||
#[allow(unused_variables)]
|
||||
fn read_host_object<'s>(
|
||||
&mut self,
|
||||
scope: &mut HandleScope<'s>,
|
||||
value_deserializer: &mut dyn ValueDeserializerHelper,
|
||||
_value_deserializer: &mut dyn ValueDeserializerHelper,
|
||||
) -> Option<Local<'s, Object>> {
|
||||
let msg =
|
||||
String::new(scope, "Deno deserializer: read_host_object not implemented")
|
||||
|
@ -164,11 +163,10 @@ pub trait ValueDeserializerImpl {
|
|||
None
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
fn get_shared_array_buffer_from_id<'s>(
|
||||
&mut self,
|
||||
scope: &mut HandleScope<'s>,
|
||||
transfer_id: u32,
|
||||
_transfer_id: u32,
|
||||
) -> Option<Local<'s, SharedArrayBuffer>> {
|
||||
let msg = String::new(
|
||||
scope,
|
||||
|
@ -180,11 +178,10 @@ pub trait ValueDeserializerImpl {
|
|||
None
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
fn get_wasm_module_from_id<'s>(
|
||||
&mut self,
|
||||
scope: &mut HandleScope<'s>,
|
||||
clone_id: u32,
|
||||
_clone_id: u32,
|
||||
) -> Option<Local<'s, WasmModuleObject>> {
|
||||
let msg = String::new(
|
||||
scope,
|
||||
|
@ -221,6 +218,7 @@ impl<'a, 's> ValueDeserializerHeap<'a, 's> {
|
|||
}
|
||||
|
||||
/// Starting from 'this' pointer a ValueDeserializerHeap ref can be created
|
||||
#[allow(dead_code)]
|
||||
pub unsafe fn dispatch(
|
||||
value_serializer_delegate: &'s CxxValueDeserializerDelegate,
|
||||
) -> &Self {
|
||||
|
|
|
@ -210,12 +210,11 @@ pub trait ValueSerializerImpl {
|
|||
message: Local<'s, String>,
|
||||
);
|
||||
|
||||
#[allow(unused_variables)]
|
||||
fn write_host_object<'s>(
|
||||
&mut self,
|
||||
scope: &mut HandleScope<'s>,
|
||||
object: Local<'s, Object>,
|
||||
value_serializer: &mut dyn ValueSerializerHelper,
|
||||
_object: Local<'s, Object>,
|
||||
_value_serializer: &mut dyn ValueSerializerHelper,
|
||||
) -> Option<bool> {
|
||||
let msg =
|
||||
String::new(scope, "Deno serializer: write_host_object not implemented")
|
||||
|
@ -225,11 +224,10 @@ pub trait ValueSerializerImpl {
|
|||
None
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
fn get_shared_array_buffer_id<'s>(
|
||||
&mut self,
|
||||
scope: &mut HandleScope<'s>,
|
||||
shared_array_buffer: Local<'s, SharedArrayBuffer>,
|
||||
_shared_array_buffer: Local<'s, SharedArrayBuffer>,
|
||||
) -> Option<u32> {
|
||||
let msg = String::new(
|
||||
scope,
|
||||
|
@ -241,11 +239,10 @@ pub trait ValueSerializerImpl {
|
|||
None
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
fn get_wasm_module_transfer_id(
|
||||
&mut self,
|
||||
scope: &mut HandleScope<'_>,
|
||||
module: Local<WasmModuleObject>,
|
||||
_module: Local<WasmModuleObject>,
|
||||
) -> Option<u32> {
|
||||
let msg = String::new(
|
||||
scope,
|
||||
|
@ -283,6 +280,7 @@ impl<'a, 's> ValueSerializerHeap<'a, 's> {
|
|||
}
|
||||
|
||||
/// Starting from 'this' pointer a ValueSerializerHeap ref can be created
|
||||
#[allow(dead_code)]
|
||||
pub unsafe fn dispatch(
|
||||
value_serializer_delegate: &'s CxxValueSerializerDelegate,
|
||||
) -> &Self {
|
||||
|
|
Loading…
Reference in a new issue