mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Enter a compartment when calling timeout handlers.
This commit is contained in:
parent
0016b1839e
commit
3a5fc11bb8
1 changed files with 9 additions and 6 deletions
|
@ -787,12 +787,15 @@ impl ScriptTask {
|
||||||
None => return,
|
None => return,
|
||||||
Some(timer_handle) => {
|
Some(timer_handle) => {
|
||||||
// TODO: Support extra arguments. This requires passing a `*JSVal` array as `argv`.
|
// TODO: Support extra arguments. This requires passing a `*JSVal` array as `argv`.
|
||||||
let rval = NullValue();
|
let cx = self.get_cx();
|
||||||
unsafe {
|
with_compartment(cx, this_value, || {
|
||||||
JS_CallFunctionValue(self.get_cx(), this_value,
|
let rval = NullValue();
|
||||||
*timer_handle.data.funval,
|
unsafe {
|
||||||
0, ptr::null(), &rval);
|
JS_CallFunctionValue(cx, this_value,
|
||||||
}
|
*timer_handle.data.funval,
|
||||||
|
0, ptr::null(), &rval);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
is_interval = timer_handle.data.is_interval;
|
is_interval = timer_handle.data.is_interval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue