diff --git a/src/handle_scope.rs b/src/handle_scope.rs index 5a6d836c..54fac06d 100644 --- a/src/handle_scope.rs +++ b/src/handle_scope.rs @@ -45,11 +45,6 @@ impl<'s> HandleScope { let isolate: *mut Isolate = parent.isolate(); 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 { diff --git a/tests/compile_fail/handle_scope_escape_to_nowhere.stderr b/tests/compile_fail/handle_scope_escape_to_nowhere.stderr index 0fb01fa4..ebd535ac 100644 --- a/tests/compile_fail/handle_scope_escape_to_nowhere.stderr +++ b/tests/compile_fail/handle_scope_escape_to_nowhere.stderr @@ -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()); | ^^^^^^^^^^ 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` | = help: the following implementations were found: diff --git a/tests/test_api.rs b/tests/test_api.rs index 2f302a56..1467ff04 100644 --- a/tests/test_api.rs +++ b/tests/test_api.rs @@ -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] #[allow(clippy::float_cmp)] fn handle_scope_numbers() {