0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-12-26 17:19:09 -05:00

refactor: v8::Context::set_promise_hooks requires scope (#1185)

This commit is contained in:
Bartek Iwańczuk 2023-02-05 20:14:57 +01:00 committed by GitHub
parent 876240bd16
commit 83b54692c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -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<Local<Function>>,
before_hook: Option<Local<Function>>,
after_hook: Option<Local<Function>>,

View file

@ -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) {