Replace NonNullJSObjectPtr with std::ptr::NonNull<JSObject>

This commit is contained in:
Simon Sapin 2018-01-22 12:42:05 +01:00
parent 897a5b39c5
commit 52eda6082f
22 changed files with 79 additions and 111 deletions

View file

@ -6,7 +6,6 @@ use document_loader::DocumentLoader;
use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
use dom::bindings::codegen::Bindings::XMLDocumentBinding::{self, XMLDocumentMethods};
use dom::bindings::inheritance::Castable;
use dom::bindings::nonnull::NonNullJSObjectPtr;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::root::DomRoot;
use dom::bindings::str::DOMString;
@ -16,8 +15,10 @@ use dom::node::Node;
use dom::window::Window;
use dom_struct::dom_struct;
use js::jsapi::JSContext;
use js::jsapi::JSObject;
use script_traits::DocumentActivity;
use servo_url::{MutableOrigin, ServoUrl};
use std::ptr::NonNull;
// https://dom.spec.whatwg.org/#xmldocument
#[dom_struct]
@ -101,7 +102,7 @@ impl XMLDocumentMethods for XMLDocument {
#[allow(unsafe_code)]
// https://html.spec.whatwg.org/multipage/#dom-tree-accessors:dom-document-nameditem-filter
unsafe fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString) -> Option<NonNullJSObjectPtr> {
unsafe fn NamedGetter(&self, _cx: *mut JSContext, name: DOMString) -> Option<NonNull<JSObject>> {
self.upcast::<Document>().NamedGetter(_cx, name)
}
}