Instate a pre-wrap hook that outerizes its argument, to satisfy an undocumented JSAPI requirement.

This commit is contained in:
Ms2ger 2014-05-14 17:39:13 +02:00
parent 8f63c9e1c8
commit 85285113e4
3 changed files with 24 additions and 4 deletions

View file

@ -11,7 +11,8 @@ use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast, ElementCas
use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalSettable};
use dom::bindings::js::OptionalRootable;
use dom::bindings::trace::{Traceable, Untraceable};
use dom::bindings::utils::{Reflectable, GlobalStaticData, wrap_for_same_compartment};
use dom::bindings::utils::{Reflectable, GlobalStaticData};
use dom::bindings::utils::{wrap_for_same_compartment, pre_wrap};
use dom::document::{Document, HTMLDocument, DocumentMethods, DocumentHelpers};
use dom::element::{Element, AttributeHandlers};
use dom::event::{Event_, ResizeEvent, ReflowEvent, ClickEvent, MouseDownEvent, MouseMoveEvent, MouseUpEvent};
@ -647,11 +648,11 @@ impl ScriptTask {
let callback = JS_SetWrapObjectCallbacks((*js_runtime).ptr,
ptr::null(),
wrap_for_same_compartment,
ptr::null());
None);
JS_SetWrapObjectCallbacks((*js_runtime).ptr,
callback,
wrap_for_same_compartment,
ptr::null());
Some(pre_wrap));
}
let js_context = js_runtime.cx();