mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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,
|
||||
Some(timer_handle) => {
|
||||
// TODO: Support extra arguments. This requires passing a `*JSVal` array as `argv`.
|
||||
let rval = NullValue();
|
||||
unsafe {
|
||||
JS_CallFunctionValue(self.get_cx(), this_value,
|
||||
*timer_handle.data.funval,
|
||||
0, ptr::null(), &rval);
|
||||
}
|
||||
let cx = self.get_cx();
|
||||
with_compartment(cx, this_value, || {
|
||||
let rval = NullValue();
|
||||
unsafe {
|
||||
JS_CallFunctionValue(cx, this_value,
|
||||
*timer_handle.data.funval,
|
||||
0, ptr::null(), &rval);
|
||||
}
|
||||
});
|
||||
|
||||
is_interval = timer_handle.data.is_interval;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue