mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
script creates methods taking '*mut JSContext' unsafe
rebase + marked the necessary new code as unsafe
This commit is contained in:
parent
9fd6f0acd5
commit
b372e7c98f
28 changed files with 274 additions and 226 deletions
|
@ -140,6 +140,7 @@ pub enum CompiledEventListener {
|
|||
}
|
||||
|
||||
impl CompiledEventListener {
|
||||
#[allow(unsafe_code)]
|
||||
// https://html.spec.whatwg.org/multipage/#the-event-handler-processing-algorithm
|
||||
pub fn call_or_handle_event<T: Reflectable>(&self,
|
||||
object: &T,
|
||||
|
@ -155,7 +156,7 @@ impl CompiledEventListener {
|
|||
CommonEventHandler::ErrorEventHandler(ref handler) => {
|
||||
if let Some(event) = event.downcast::<ErrorEvent>() {
|
||||
let cx = object.global().get_cx();
|
||||
rooted!(in(cx) let error = event.Error(cx));
|
||||
rooted!(in(cx) let error = unsafe { event.Error(cx) });
|
||||
let return_value = handler.Call_(object,
|
||||
EventOrString::String(event.Message()),
|
||||
Some(event.Filename()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue