0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-21 15:04:33 -05:00

chore: rename rusty_v8 to v8 (#803)

This commit is contained in:
Luca Casonato 2021-10-27 14:32:12 +02:00 committed by GitHub
parent 188105bec7
commit 5ee0a375f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 73 additions and 99 deletions

View file

@ -70,7 +70,7 @@ jobs:
uses: hecrj/setup-rust-action@v1
with:
components: clippy, rustfmt
rust-version: 1.55.0
rust-version: 1.56.0
- name: Install python
uses: actions/setup-python@v2

26
Cargo.lock generated
View file

@ -72,19 +72,6 @@ dependencies = [
"proc-macro2",
]
[[package]]
name = "rusty_v8"
version = "0.32.0"
dependencies = [
"align-data",
"bitflags",
"fslock",
"lazy_static",
"libc",
"trybuild",
"which",
]
[[package]]
name = "ryu"
version = "1.0.5"
@ -171,6 +158,19 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
[[package]]
name = "v8"
version = "0.32.0"
dependencies = [
"align-data",
"bitflags",
"fslock",
"lazy_static",
"libc",
"trybuild",
"which",
]
[[package]]
name = "which"
version = "4.1.0"

View file

@ -1,5 +1,5 @@
[package]
name = "rusty_v8"
name = "v8"
version = "0.32.0"
description = "Rust bindings to V8"
readme = "README.md"

View file

@ -3,8 +3,8 @@
V8 Version: 9.6.180.8
[![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)
[![docs](https://docs.rs/rusty_v8/badge.svg)](https://docs.rs/rusty_v8)
[![crates](https://img.shields.io/crates/v/v8.svg)](https://crates.io/crates/v8)
[![docs](https://docs.rs/v8/badge.svg)](https://docs.rs/v8)
## Goals

View file

@ -1,5 +1,3 @@
use rusty_v8 as v8;
fn main() {
// Initialize V8.
let platform = v8::new_default_platform(0, false).make_shared();

View file

@ -1,4 +1,3 @@
use rusty_v8 as v8;
use std::collections::HashMap;
use std::convert::TryFrom;

View file

@ -1,5 +1,3 @@
use rusty_v8 as v8;
fn main() {
// Initialize V8.
let platform = v8::new_default_platform(0, false).make_shared();

View file

@ -99,7 +99,6 @@ pub fn set_flags_from_command_line(args: Vec<String>) -> Vec<String> {
/// # Examples
///
/// ```
/// use rusty_v8 as v8;
/// let r = v8::V8::set_flags_from_command_line_with_usage(
/// vec!["binaryname".to_string(), "--help".to_string()],
/// Some("Usage: binaryname --startup-src=file\n\n"),

View file

@ -3,8 +3,7 @@
//! # Example
//!
//! ```rust
//! use rusty_v8 as v8;
//!
//! //!
//! let platform = v8::new_default_platform(0, false).make_shared();
//! v8::V8::initialize_platform(platform);
//! v8::V8::initialize();

View file

@ -853,7 +853,7 @@ mod tests {
#[test]
#[should_panic(expected = "assertion failed: \
`SharedPtr<rusty_v8::support::tests::MockSharedObj>` reference count \
`SharedPtr<v8::support::tests::MockSharedObj>` reference count \
does not match expectation")]
fn shared_ptr_use_count_assertion_failed() {
let shared_ptr: SharedPtr<MockSharedObj> = Default::default();
@ -862,7 +862,7 @@ mod tests {
#[test]
#[should_panic(expected = "assertion failed: \
`SharedRef<rusty_v8::support::tests::MockSharedObj>` reference count \
`SharedRef<v8::support::tests::MockSharedObj>` reference count \
does not match expectation")]
fn shared_ref_use_count_assertion_failed() {
let shared_ref = SharedRef(MockSharedObj::SHARED_PTR_BASE_B);

View file

@ -1,5 +1,4 @@
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
use rusty_v8 as v8;
pub fn main() {
let mut isolate = v8::Isolate::new(mock());

View file

@ -1,11 +1,11 @@
error[E0597]: `scope2` does not live long enough
--> $DIR/boxed_local.rs:10:43
--> $DIR/boxed_local.rs:9:43
|
8 | let _boxed_local = {
7 | let _boxed_local = {
| ------------ borrow later stored here
9 | let mut scope2 = v8::HandleScope::new(&mut scope1);
10 | let mut scope3 = v8::HandleScope::new(&mut scope2);
8 | let mut scope2 = v8::HandleScope::new(&mut scope1);
9 | let mut scope3 = v8::HandleScope::new(&mut scope2);
| ^^^^^^^^^^^ borrowed value does not live long enough
11 | Box::new(v8::Integer::new(&mut scope3, 123))
12 | };
10 | Box::new(v8::Integer::new(&mut scope3, 123))
11 | };
| - `scope2` dropped here while still borrowed

View file

@ -1,5 +1,4 @@
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
use rusty_v8 as v8;
pub fn main() {
let mut isolate = v8::Isolate::new(mock());

View file

@ -1,11 +1,11 @@
error[E0597]: `scope2` does not live long enough
--> $DIR/handle_scope_escape_lifetime.rs:10:43
--> $DIR/handle_scope_escape_lifetime.rs:9:43
|
8 | let _local = {
7 | let _local = {
| ------ borrow later stored here
9 | let mut scope2 = v8::HandleScope::new(&mut scope1);
10 | let mut scope3 = v8::HandleScope::new(&mut scope2);
8 | let mut scope2 = v8::HandleScope::new(&mut scope1);
9 | let mut scope3 = v8::HandleScope::new(&mut scope2);
| ^^^^^^^^^^^ borrowed value does not live long enough
...
14 | };
13 | };
| - `scope2` dropped here while still borrowed

View file

@ -1,5 +1,4 @@
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
use rusty_v8 as v8;
pub fn main() {
let mut isolate = v8::Isolate::new(mock());

View file

@ -1,8 +1,8 @@
error[E0277]: the trait bound `OwnedIsolate: rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not satisfied
--> $DIR/handle_scope_escape_to_nowhere.rs:6:50
error[E0277]: the trait bound `OwnedIsolate: v8::scope::param::NewEscapableHandleScope<'_, '_>` is not satisfied
--> $DIR/handle_scope_escape_to_nowhere.rs:5:50
|
6 | let mut _scope = v8::EscapableHandleScope::new(&mut isolate);
| ^^^^^^^^^^^^ the trait `rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not implemented for `OwnedIsolate`
5 | let mut _scope = v8::EscapableHandleScope::new(&mut isolate);
| ^^^^^^^^^^^^ the trait `v8::scope::param::NewEscapableHandleScope<'_, '_>` is not implemented for `OwnedIsolate`
|
note: required by `EscapableHandleScope::<'s, 'e>::new`
--> $DIR/scope.rs:303:3
@ -12,8 +12,8 @@ note: required by `EscapableHandleScope::<'s, 'e>::new`
305 | | ) -> P::NewScope {
| |__________________^
error[E0277]: the trait bound `OwnedIsolate: rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not satisfied
--> $DIR/handle_scope_escape_to_nowhere.rs:6:20
error[E0277]: the trait bound `OwnedIsolate: v8::scope::param::NewEscapableHandleScope<'_, '_>` is not satisfied
--> $DIR/handle_scope_escape_to_nowhere.rs:5:20
|
6 | let mut _scope = v8::EscapableHandleScope::new(&mut isolate);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rusty_v8::scope::param::NewEscapableHandleScope<'_, '_>` is not implemented for `OwnedIsolate`
5 | let mut _scope = v8::EscapableHandleScope::new(&mut isolate);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `v8::scope::param::NewEscapableHandleScope<'_, '_>` is not implemented for `OwnedIsolate`

View file

@ -1,5 +1,4 @@
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
use rusty_v8 as v8;
pub fn main() {
let mut isolate = v8::Isolate::new(mock());

View file

@ -1,9 +1,9 @@
error[E0499]: cannot borrow `scope1` as mutable more than once at a time
--> $DIR/handle_scope_lifetime_1.rs:8:33
--> $DIR/handle_scope_lifetime_1.rs:7:33
|
7 | let mut _scope2 = v8::EscapableHandleScope::new(&mut scope1);
6 | let mut _scope2 = v8::EscapableHandleScope::new(&mut scope1);
| ----------- first mutable borrow occurs here
8 | let _local = v8::Integer::new(&mut scope1, 123);
7 | let _local = v8::Integer::new(&mut scope1, 123);
| ^^^^^^^^^^^ second mutable borrow occurs here
9 | }
8 | }
| - first borrow might be used here, when `_scope2` is dropped and runs the `Drop` code for type `EscapableHandleScope`

View file

@ -1,5 +1,4 @@
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
use rusty_v8 as v8;
pub fn main() {
let mut isolate = v8::Isolate::new(mock());

View file

@ -1,9 +1,9 @@
error[E0499]: cannot borrow `scope1` as mutable more than once at a time
--> $DIR/handle_scope_lifetime_2.rs:8:34
--> $DIR/handle_scope_lifetime_2.rs:7:34
|
7 | let mut scope2 = v8::EscapableHandleScope::new(&mut scope1);
6 | let mut scope2 = v8::EscapableHandleScope::new(&mut scope1);
| ----------- first mutable borrow occurs here
8 | let _local1 = v8::Integer::new(&mut scope1, 123);
7 | let _local1 = v8::Integer::new(&mut scope1, 123);
| ^^^^^^^^^^^ second mutable borrow occurs here
9 | let _local2 = v8::Integer::new(&mut scope2, 123);
8 | let _local2 = v8::Integer::new(&mut scope2, 123);
| ----------- first borrow later used here

View file

@ -1,6 +1,4 @@
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
use rusty_v8 as v8;
pub fn main() {
let mut isolate = v8::Isolate::new(mock());
let mut scope1 = v8::HandleScope::new(&mut isolate);

View file

@ -1,9 +1,9 @@
error[E0499]: cannot borrow `scope1` as mutable more than once at a time
--> $DIR/handle_scope_lifetime_3.rs:10:22
|
9 | let mut _scope2 = v8::EscapableHandleScope::new(&mut scope1);
| ----------- first mutable borrow occurs here
10 | v8::Integer::new(&mut scope1, 123)
| ^^^^^^^^^^^ second mutable borrow occurs here
11 | };
| - first borrow might be used here, when `_scope2` is dropped and runs the `Drop` code for type `EscapableHandleScope`
--> $DIR/handle_scope_lifetime_3.rs:8:22
|
7 | let mut _scope2 = v8::EscapableHandleScope::new(&mut scope1);
| ----------- first mutable borrow occurs here
8 | v8::Integer::new(&mut scope1, 123)
| ^^^^^^^^^^^ second mutable borrow occurs here
9 | };
| - first borrow might be used here, when `_scope2` is dropped and runs the `Drop` code for type `EscapableHandleScope`

View file

@ -1,5 +1,4 @@
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
use rusty_v8 as v8;
pub fn main() {
let mut isolate = v8::Isolate::new(mock());

View file

@ -1,10 +1,10 @@
error[E0597]: `scope2` does not live long enough
--> $DIR/handle_scope_lifetime_4.rs:10:35
--> $DIR/handle_scope_lifetime_4.rs:9:35
|
8 | let mut _scope3 = {
7 | let mut _scope3 = {
| ----------- borrow later stored here
9 | let mut scope2 = v8::HandleScope::new(&mut scope1);
10 | v8::EscapableHandleScope::new(&mut scope2)
8 | let mut scope2 = v8::HandleScope::new(&mut scope1);
9 | v8::EscapableHandleScope::new(&mut scope2)
| ^^^^^^^^^^^ borrowed value does not live long enough
11 | };
10 | };
| - `scope2` dropped here while still borrowed

View file

@ -1,5 +1,4 @@
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
use rusty_v8 as v8;
pub fn main() {
let mut isolate = v8::Isolate::new(mock());

View file

@ -1,8 +1,8 @@
error[E0308]: mismatched types
--> $DIR/object_without_context_scope.rs:7:33
--> $DIR/object_without_context_scope.rs:6:33
|
7 | let _object = v8::Object::new(&mut scope);
| ^^^^^^^^^^ expected struct `rusty_v8::Context`, found `()`
6 | let _object = v8::Object::new(&mut scope);
| ^^^^^^^^^^ expected struct `v8::Context`, found `()`
|
= note: expected mutable reference `&mut HandleScope<'_>`
found mutable reference `&mut HandleScope<'_, ()>`

View file

@ -1,5 +1,4 @@
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
use rusty_v8 as v8;
pub fn main() {
let mut isolate = v8::Isolate::new(mock());

View file

@ -1,11 +1,11 @@
error[E0597]: `scope3` does not live long enough
--> $DIR/try_catch_exception_lifetime.rs:12:43
--> $DIR/try_catch_exception_lifetime.rs:11:43
|
10 | let _exception = {
9 | let _exception = {
| ---------- borrow later stored here
11 | let mut scope3 = v8::HandleScope::new(&mut scope2);
12 | let mut scope4 = v8::HandleScope::new(&mut scope3);
10 | let mut scope3 = v8::HandleScope::new(&mut scope2);
11 | let mut scope4 = v8::HandleScope::new(&mut scope3);
| ^^^^^^^^^^^ borrowed value does not live long enough
...
15 | };
14 | };
| - `scope3` dropped here while still borrowed

View file

@ -1,5 +1,4 @@
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
use rusty_v8 as v8;
pub fn main() {
let mut isolate = v8::Isolate::new(mock());

View file

@ -1,11 +1,11 @@
error[E0597]: `scope3` does not live long enough
--> $DIR/try_catch_message_lifetime.rs:12:43
--> $DIR/try_catch_message_lifetime.rs:11:43
|
10 | let _message = {
9 | let _message = {
| -------- borrow later stored here
11 | let mut scope3 = v8::HandleScope::new(&mut scope2);
12 | let mut scope4 = v8::HandleScope::new(&mut scope3);
10 | let mut scope3 = v8::HandleScope::new(&mut scope2);
11 | let mut scope4 = v8::HandleScope::new(&mut scope3);
| ^^^^^^^^^^^ borrowed value does not live long enough
...
15 | };
14 | };
| - `scope3` dropped here while still borrowed

View file

@ -3,7 +3,6 @@
// layers: v8::Isolate -> CoreIsolate -> EsIsolate
// This demonstrates how this can be done in a safe way.
use rusty_v8 as v8;
use std::ops::Deref;
use std::ops::DerefMut;
use std::rc::Rc;

View file

@ -14,7 +14,6 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use std::sync::Mutex;
use rusty_v8 as v8;
// TODO(piscisaureus): Ideally there would be no need to import this trait.
use v8::MapFnTo;

View file

@ -1,7 +1,6 @@
// Tests from the same file run in a single process. That's why this test
// is in its own file, because changing the entropy source affects the
// whole process.
use rusty_v8 as v8;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;

View file

@ -1,6 +1,5 @@
// Tests from the same file run in a single process. That's why this test
// is in its own file, because changing flags affects the whole process.
use rusty_v8 as v8;
#[test]
fn set_flags_from_string() {

View file

@ -1,5 +1,3 @@
use rusty_v8 as v8;
#[test]
fn atomics_pump_message_loop() {
v8::V8::set_flags_from_string("--harmony-top-level-await --allow-natives-syntax --harmony-sharedarraybuffer");

View file

@ -1,5 +1,3 @@
use rusty_v8 as v8;
#[test]
fn single_threaded_default_platform() {
v8::V8::set_flags_from_string("--single_threaded");