mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
Fix a dynamic borrow error when executing timer callbacks.
This commit is contained in:
parent
ab743c17fe
commit
6bd4306d70
1 changed files with 2 additions and 3 deletions
|
@ -504,16 +504,15 @@ impl ScriptTask {
|
||||||
let page = self.page_tree.find(id).expect("ScriptTask: received fire timer msg for a
|
let page = self.page_tree.find(id).expect("ScriptTask: received fire timer msg for a
|
||||||
pipeline ID not associated with this script task. This is a bug.").page;
|
pipeline ID not associated with this script task. This is a bug.").page;
|
||||||
unsafe {
|
unsafe {
|
||||||
let js_info = page.js_info.get_ref();
|
|
||||||
let this_value = if timer_data.args.len() > 0 {
|
let this_value = if timer_data.args.len() > 0 {
|
||||||
RUST_JSVAL_TO_OBJECT(timer_data.args[0])
|
RUST_JSVAL_TO_OBJECT(timer_data.args[0])
|
||||||
} else {
|
} else {
|
||||||
js_info.js_compartment.global_obj.ptr
|
page.js_info.get_ref().js_compartment.global_obj.ptr
|
||||||
};
|
};
|
||||||
|
|
||||||
// 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 = JSVAL_NULL;
|
let rval = JSVAL_NULL;
|
||||||
JS_CallFunctionValue(js_info.js_context.ptr,
|
JS_CallFunctionValue(page.js_info.get_ref().js_context.ptr,
|
||||||
this_value,
|
this_value,
|
||||||
timer_data.funval,
|
timer_data.funval,
|
||||||
0,
|
0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue