From 83b54692c1ea031a978b8176222b7f6713dc88f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 5 Feb 2023 20:14:57 +0100 Subject: [PATCH] refactor: v8::Context::set_promise_hooks requires scope (#1185) --- src/context.rs | 3 ++- tests/test_api.rs | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/context.rs b/src/context.rs index d03c6715..2437b3a6 100644 --- a/src/context.rs +++ b/src/context.rs @@ -108,8 +108,9 @@ impl Context { } #[inline(always)] - pub fn set_promise_hooks( + pub fn set_promise_hooks<'s>( &self, + _scope: &mut HandleScope<'s, ()>, init_hook: Option>, before_hook: Option>, after_hook: Option>, diff --git a/tests/test_api.rs b/tests/test_api.rs index 7c961c0e..7165a50c 100644 --- a/tests/test_api.rs +++ b/tests/test_api.rs @@ -3270,6 +3270,7 @@ fn context_promise_hooks() { ) .unwrap(); context.set_promise_hooks( + scope, Some(init_hook), Some(before_hook), Some(after_hook), @@ -3348,7 +3349,13 @@ fn context_promise_hooks_partial() { .unwrap(), ) .unwrap(); - context.set_promise_hooks(Some(init_hook), Some(before_hook), None, None); + context.set_promise_hooks( + scope, + Some(init_hook), + Some(before_hook), + None, + None, + ); let source = r#" function expect(expected, actual = promises.size) {