0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-12-25 00:29:14 -05:00

Revert "Add HandleScope::new2 hack to construct from const ref (#290)"

It's not pretty, and we currently don't need it in Deno.

This reverts commit 4f0662ed57.
This commit is contained in:
Bert Belder 2020-02-25 17:20:12 -08:00
parent eba98e7a5e
commit 3803e07065
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
3 changed files with 2 additions and 19 deletions

View file

@ -45,11 +45,6 @@ impl<'s> HandleScope {
let isolate: *mut Isolate = parent.isolate(); let isolate: *mut Isolate = parent.isolate();
Scope::new(isolate, parent) Scope::new(isolate, parent)
} }
// TODO(ry) Remove this. This is a hack so we can upgrade Deno.
pub unsafe fn new2(isolate: &Isolate) -> Scope<'s, Self> {
Scope::new_root(isolate as *const _ as *mut Isolate)
}
} }
unsafe impl<'s> ScopeDefinition<'s> for HandleScope { unsafe impl<'s> ScopeDefinition<'s> for HandleScope {

View file

@ -4,9 +4,9 @@ error[E0277]: the trait bound `rusty_v8::scope::Entered<'_, rusty_v8::scope::Cal
7 | let _hs = v8::EscapableHandleScope::new(cs.enter()); 7 | let _hs = v8::EscapableHandleScope::new(cs.enter());
| ^^^^^^^^^^ the trait `rusty_v8::scope_traits::ToLocal<'_>` is not implemented for `rusty_v8::scope::Entered<'_, rusty_v8::scope::CallbackScope>` | ^^^^^^^^^^ the trait `rusty_v8::scope_traits::ToLocal<'_>` is not implemented for `rusty_v8::scope::Entered<'_, rusty_v8::scope::CallbackScope>`
| |
::: $WORKSPACE/src/handle_scope.rs:76:8 ::: $WORKSPACE/src/handle_scope.rs:71:8
| |
76 | P: ToLocalOrReturnsLocal<'p>, 71 | P: ToLocalOrReturnsLocal<'p>,
| ------------------------- required by this bound in `rusty_v8::handle_scope::EscapableHandleScope::new` | ------------------------- required by this bound in `rusty_v8::handle_scope::EscapableHandleScope::new`
| |
= help: the following implementations were found: = help: the following implementations were found:

View file

@ -50,18 +50,6 @@ fn handle_scope_nested() {
} }
} }
#[test]
fn handle_scope_hack() {
let _setup_guard = setup();
let mut params = v8::Isolate::create_params();
params.set_array_buffer_allocator(v8::new_default_allocator());
let isolate = v8::Isolate::new(params);
let mut hs = unsafe { v8::HandleScope::new2(&isolate) };
let scope1 = hs.enter();
let l1 = v8::Integer::new(scope1, -123);
assert_eq!(v8::Integer::value(&l1), -123);
}
#[test] #[test]
#[allow(clippy::float_cmp)] #[allow(clippy::float_cmp)]
fn handle_scope_numbers() { fn handle_scope_numbers() {