mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Panic if JS_NewObjectWithGivenProto fails.
This commit is contained in:
parent
5f5381e4c1
commit
46e4ac280f
1 changed files with 1 additions and 7 deletions
|
@ -63,10 +63,6 @@ pub unsafe extern fn defineProperty_(cx: *mut JSContext, proxy: *mut JSObject, i
|
|||
}
|
||||
|
||||
let expando = EnsureExpandoObject(cx, proxy);
|
||||
if expando.is_null() {
|
||||
return false;
|
||||
}
|
||||
|
||||
return JS_DefinePropertyById(cx, expando, id, (*desc).value, (*desc).getter,
|
||||
(*desc).setter, (*desc).attrs) != 0;
|
||||
}
|
||||
|
@ -115,9 +111,7 @@ pub fn EnsureExpandoObject(cx: *mut JSContext, obj: *mut JSObject) -> *mut JSObj
|
|||
expando = JS_NewObjectWithGivenProto(cx, ptr::null_mut(),
|
||||
ptr::null_mut(),
|
||||
GetObjectParent(obj));
|
||||
if expando.is_null() {
|
||||
return ptr::null_mut();
|
||||
}
|
||||
assert!(!expando.is_null());
|
||||
|
||||
SetProxyExtra(obj, JSPROXYSLOT_EXPANDO, ObjectValue(&*expando));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue