Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393

This commit is contained in:
Marcin Mielniczuk 2018-03-28 21:28:30 +02:00
parent e04d517bff
commit 356c57e628
48 changed files with 403 additions and 307 deletions

View file

@ -14,8 +14,9 @@ use dom::testbinding::TestBindingCallback;
use dom::xmlhttprequest::XHRTimeoutCallback;
use euclid::Length;
use ipc_channel::ipc::IpcSender;
use js::jsapi::{HandleValue, Heap};
use js::jsapi::Heap;
use js::jsval::{JSVal, UndefinedValue};
use js::rust::HandleValue;
use script_traits::{MsDuration, precise_time_ms};
use script_traits::{TimerEvent, TimerEventId, TimerEventRequest};
use script_traits::{TimerSchedulerMsg, TimerSource};
@ -520,7 +521,7 @@ impl JsTimerTask {
// Returning Handles directly from Heap values is inherently unsafe, but here it's
// always done via rooted JsTimers, which is safe.
#[allow(unsafe_code)]
fn collect_heap_args(&self, args: &[Heap<JSVal>]) -> Vec<HandleValue> {
fn collect_heap_args<'b>(&self, args: &'b [Heap<JSVal>]) -> Vec<HandleValue<'b>> {
args.iter().map(|arg| unsafe { arg.handle() }).collect()
}
}