Enter a compartment when calling timeout handlers.

This commit is contained in:
Ms2ger 2014-05-05 23:08:04 +02:00
parent 0016b1839e
commit 3a5fc11bb8

View file

@ -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;
}