mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Stop using ptr.is_not_null() in script.
This method is deprecated in rust master; removing its users in advance will make a future rust upgrade smoother.
This commit is contained in:
parent
111a196e9d
commit
43eecf6e7a
8 changed files with 27 additions and 27 deletions
|
@ -214,10 +214,10 @@ fn CreateInterfaceObject(cx: *mut JSContext, global: *mut JSObject, receiver: *m
|
|||
unsafe {
|
||||
let fun = JS_NewFunction(cx, Some(constructorNative), ctorNargs,
|
||||
JSFUN_CONSTRUCTOR, global, name);
|
||||
assert!(fun.is_not_null());
|
||||
assert!(!fun.is_null());
|
||||
|
||||
let constructor = JS_GetFunctionObject(fun);
|
||||
assert!(constructor.is_not_null());
|
||||
assert!(!constructor.is_null());
|
||||
|
||||
match members.staticMethods {
|
||||
Some(staticMethods) => DefineMethods(cx, constructor, staticMethods),
|
||||
|
@ -234,7 +234,7 @@ fn CreateInterfaceObject(cx: *mut JSContext, global: *mut JSObject, receiver: *m
|
|||
_ => (),
|
||||
}
|
||||
|
||||
if proto.is_not_null() {
|
||||
if !proto.is_null() {
|
||||
assert!(JS_LinkConstructorAndPrototype(cx, constructor, proto) != 0);
|
||||
}
|
||||
|
||||
|
@ -288,7 +288,7 @@ fn CreateInterfacePrototypeObject(cx: *mut JSContext, global: *mut JSObject,
|
|||
members: &'static NativeProperties) -> *mut JSObject {
|
||||
unsafe {
|
||||
let ourProto = JS_NewObjectWithUniqueType(cx, protoClass, &*parentProto, &*global);
|
||||
assert!(ourProto.is_not_null());
|
||||
assert!(!ourProto.is_null());
|
||||
|
||||
match members.methods {
|
||||
Some(methods) => DefineMethods(cx, ourProto, methods),
|
||||
|
@ -366,7 +366,7 @@ impl Reflector {
|
|||
/// Initialize the reflector. (May be called only once.)
|
||||
pub fn set_jsobject(&self, object: *mut JSObject) {
|
||||
assert!(self.object.get().is_null());
|
||||
assert!(object.is_not_null());
|
||||
assert!(!object.is_null());
|
||||
self.object.set(object);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue