mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-25 15:29:43 -05:00
refactor: v8::Context::set_promise_hooks requires scope (#1185)
This commit is contained in:
parent
876240bd16
commit
83b54692c1
2 changed files with 10 additions and 2 deletions
|
@ -108,8 +108,9 @@ impl Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn set_promise_hooks(
|
pub fn set_promise_hooks<'s>(
|
||||||
&self,
|
&self,
|
||||||
|
_scope: &mut HandleScope<'s, ()>,
|
||||||
init_hook: Option<Local<Function>>,
|
init_hook: Option<Local<Function>>,
|
||||||
before_hook: Option<Local<Function>>,
|
before_hook: Option<Local<Function>>,
|
||||||
after_hook: Option<Local<Function>>,
|
after_hook: Option<Local<Function>>,
|
||||||
|
|
|
@ -3270,6 +3270,7 @@ fn context_promise_hooks() {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
context.set_promise_hooks(
|
context.set_promise_hooks(
|
||||||
|
scope,
|
||||||
Some(init_hook),
|
Some(init_hook),
|
||||||
Some(before_hook),
|
Some(before_hook),
|
||||||
Some(after_hook),
|
Some(after_hook),
|
||||||
|
@ -3348,7 +3349,13 @@ fn context_promise_hooks_partial() {
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
)
|
)
|
||||||
.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#"
|
let source = r#"
|
||||||
function expect(expected, actual = promises.size) {
|
function expect(expected, actual = promises.size) {
|
||||||
|
|
Loading…
Reference in a new issue