Fix build errors after rebase.

This commit is contained in:
Josh Matthews 2013-04-23 23:52:55 +02:00
parent 5bade7b0fb
commit bc26b46588
4 changed files with 9 additions and 15 deletions

View file

@ -79,10 +79,8 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode) -> jsobj {
assert!(cache.get_wrapper().is_null()); assert!(cache.get_wrapper().is_null());
cache.set_wrapper(obj.ptr); cache.set_wrapper(obj.ptr);
unsafe { let raw_ptr = node.raw_object() as *libc::c_void;
let raw_ptr = node.raw_object() as *libc::c_void; JS_SetReservedSlot(obj.ptr, DOM_OBJECT_SLOT as u32, RUST_PRIVATE_TO_JSVAL(raw_ptr));
JS_SetReservedSlot(obj.ptr, DOM_OBJECT_SLOT as u32, RUST_PRIVATE_TO_JSVAL(raw_ptr));
}
return obj; return obj;
} }

View file

@ -67,11 +67,9 @@ extern fn close(cx: *JSContext, _argc: c_uint, vp: *JSVal) -> JSBool {
} }
extern fn gc(cx: *JSContext, _argc: c_uint, _vp: *JSVal) -> JSBool { extern fn gc(cx: *JSContext, _argc: c_uint, _vp: *JSVal) -> JSBool {
unsafe { let runtime = JS_GetRuntime(cx);
let runtime = JS_GetRuntime(cx); JS_GC(runtime);
JS_GC(runtime); return 1;
return 1;
}
} }
unsafe fn unwrap(obj: *JSObject) -> *rust_box<Window> { unsafe fn unwrap(obj: *JSObject) -> *rust_box<Window> {
@ -130,9 +128,7 @@ pub fn init(compartment: @mut Compartment) {
} }
]; ];
unsafe { JS_DefineFunctions(compartment.cx.ptr, proto.ptr, &methods[0]);
JS_DefineFunctions(compartment.cx.ptr, proto.ptr, &methods[0]);
}
} }
pub fn create(compartment: @mut Compartment, win: @mut Window) { pub fn create(compartment: @mut Compartment, win: @mut Window) {

View file

@ -29,7 +29,7 @@ pub fn Document(root: AbstractNode,
do root.with_imm_node |node| { do root.with_imm_node |node| {
assert!(node.wrapper.get_wrapper().is_not_null()); assert!(node.wrapper.get_wrapper().is_not_null());
let rootable = node.wrapper.get_rootable(); let rootable = node.wrapper.get_rootable();
unsafe { JS_AddObjectRoot(compartment.cx.ptr, rootable); } JS_AddObjectRoot(compartment.cx.ptr, rootable);
} }
document::create(compartment, doc); document::create(compartment, doc);
doc doc
@ -42,7 +42,7 @@ impl Drop for Document {
do self.root.with_imm_node |node| { do self.root.with_imm_node |node| {
assert!(node.wrapper.get_wrapper().is_not_null()); assert!(node.wrapper.get_wrapper().is_not_null());
let rootable = node.wrapper.get_rootable(); let rootable = node.wrapper.get_rootable();
unsafe { JS_RemoveObjectRoot(compartment.cx.ptr, rootable); } JS_RemoveObjectRoot(compartment.cx.ptr, rootable);
} }
} }
} }

View file

@ -243,7 +243,7 @@ pub fn parse_html(url: Url,
let url = url::from_str("http://example.com/"); // FIXME let url = url::from_str("http://example.com/"); // FIXME
let url_cell = Cell(url); let url_cell = Cell(url);
do child_node.with_imm_text |text_node| { do child_node.with_imm_text |text_node| {
let data = text_node.text.to_str(); // FIXME: Bad copy. let data = text_node.parent.data.to_str(); // FIXME: Bad copy.
let provenance = InlineProvenance(result::unwrap(url_cell.take()), data); let provenance = InlineProvenance(result::unwrap(url_cell.take()), data);
css_chan2.send(CSSTaskNewFile(provenance)); css_chan2.send(CSSTaskNewFile(provenance));
} }