Move the call to RegisterBindings::Register into WindowBinding::Wrap.

This commit is contained in:
Ms2ger 2014-07-12 16:20:43 +02:00
parent 5baff0cc2c
commit ac5a2767bf
2 changed files with 4 additions and 6 deletions

View file

@ -1821,8 +1821,11 @@ Temporary::new(raw)""" % CreateBindingJSObject(self.descriptor, "scope"))
with_compartment(aCx, obj, || {
let proto = GetProtoObject(aCx, obj, obj);
JS_SetPrototype(aCx, obj, proto);
raw.reflector().set_jsobject(obj);
RegisterBindings::Register(aCx, obj);
});
raw.reflector().set_jsobject(obj);
Temporary::new(raw)""" % CreateBindingJSObject(self.descriptor))

View file

@ -5,7 +5,6 @@
//! The script task is the task that owns the DOM in memory, runs JavaScript, and spawns parsing
//! and layout tasks.
use dom::bindings::codegen::RegisterBindings;
use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast, EventCast};
use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalSettable};
use dom::bindings::js::OptionalRootable;
@ -548,10 +547,6 @@ impl ScriptTask {
let document = Document::new(&*window, Some(url.clone()), HTMLDocument, None).root();
window.deref().init_browser_context(&*document);
with_compartment((**cx).ptr, window.reflector().get_jsobject(), || {
RegisterBindings::Register(window.get_cx(), window.reflector().get_jsobject());
});
self.compositor.set_ready_state(Loading);
// Parse HTML.
//