diff --git a/BUILD.gn b/BUILD.gn index 8d8a7ac3..9f75b344 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -3,16 +3,16 @@ import("//v8/gni/v8.gni") v8_static_library("rusty_v8") { sources = [ + "src/V8.cc", "src/array_buffer.cc", "src/handle_scope.cc", "src/inspector/channel.cc", "src/inspector/client.cc", "src/isolate.cc", "src/locker.cc", - "src/platform/task.cc", "src/platform/mod.cc", + "src/platform/task.cc", "src/string_buffer.cc", - "src/v8.cc", ] deps = [ ":v8", diff --git a/src/v8.cc b/src/V8.cc similarity index 100% rename from src/v8.cc rename to src/V8.cc diff --git a/src/v8.rs b/src/V8.rs similarity index 98% rename from src/v8.rs rename to src/V8.rs index 99a226be..4c5029e6 100644 --- a/src/v8.rs +++ b/src/V8.rs @@ -1,5 +1,4 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. - use libc::c_char; use libc::c_int; use std::ffi::CStr; @@ -11,10 +10,7 @@ use crate::platform::Platform; use crate::support::UniquePtr; extern "C" { - fn v8__V8__SetFlagsFromCommandLine( - argc: *mut c_int, - argv: *mut *mut c_char, - ); + fn v8__V8__SetFlagsFromCommandLine(argc: *mut c_int, argv: *mut *mut c_char); fn v8__V8__GetVersion() -> *const c_char; fn v8__V8__InitializePlatform(platform: &'static mut Platform); fn v8__V8__Initialize(); diff --git a/src/handle_scope.rs b/src/handle_scope.rs index 61769a0f..eac1938b 100644 --- a/src/handle_scope.rs +++ b/src/handle_scope.rs @@ -67,8 +67,8 @@ mod tests { use crate::array_buffer::Allocator; use crate::isolate::*; use crate::platform::*; - use crate::v8::*; use crate::Locker; + use crate::V8::*; #[test] fn test_handle_scope() { diff --git a/src/isolate.rs b/src/isolate.rs index 5c4e8ead..0d507ba7 100644 --- a/src/isolate.rs +++ b/src/isolate.rs @@ -4,7 +4,7 @@ use crate::array_buffer::Allocator; use crate::support::Delete; use crate::support::Opaque; use crate::support::UniqueRef; -use crate::v8::assert_initialized; +use crate::V8::assert_initialized; extern "C" { fn v8__Isolate__New(params: *mut CreateParams) -> &'static mut CxxIsolate; @@ -77,7 +77,7 @@ impl Delete for CreateParams { mod tests { use super::*; use crate::platform::*; - use crate::v8::*; + use crate::V8::*; #[test] fn test_isolate() { diff --git a/src/lib.rs b/src/lib.rs index 917fa03c..dd5c5699 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,7 +18,11 @@ pub mod platform; pub mod string_buffer; pub mod string_view; pub mod support; -pub mod v8; + +// This module is intentionally named "V8" rather than "v8" to match the +// C++ namespace "v8::V8". +#[allow(non_snake_case)] +pub mod V8; pub use isolate::Isolate; pub use locker::Locker;