mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
Issue #2259 - Add mozilla::Result<V, E> and JS::Result<> for fallible return values
Based-on: m-c 1283562, 1277368/1, 1324828
This commit is contained in:
parent
9914c06168
commit
4c2e378613
20 changed files with 905 additions and 73 deletions
|
|
@ -258,9 +258,8 @@ NativeObject::createWithTemplate(JSContext* cx, gc::InitialHeap heap,
|
|||
MOZ_ASSERT(CanBeFinalizedInBackground(kind, shape->getObjectClass()));
|
||||
kind = gc::GetBackgroundAllocKind(kind);
|
||||
|
||||
JSObject* baseObj = create(cx, kind, heap, shape, group);
|
||||
if (!baseObj)
|
||||
return nullptr;
|
||||
JSObject* baseObj;
|
||||
JS_TRY_VAR_OR_RETURN_NULL(cx, baseObj, create(cx, kind, heap, shape, group));
|
||||
return &baseObj->as<NativeObject>();
|
||||
}
|
||||
|
||||
|
|
@ -272,9 +271,9 @@ NativeObject::copy(ExclusiveContext* cx, gc::AllocKind kind, gc::InitialHeap hea
|
|||
RootedObjectGroup group(cx, templateObject->group());
|
||||
MOZ_ASSERT(!templateObject->denseElementsAreCopyOnWrite());
|
||||
|
||||
JSObject* baseObj = create(cx, kind, heap, shape, group);
|
||||
if (!baseObj)
|
||||
return nullptr;
|
||||
JSObject* baseObj;
|
||||
JS_TRY_VAR_OR_RETURN_NULL(cx, baseObj, create(cx, kind, heap, shape, group));
|
||||
|
||||
NativeObject* obj = &baseObj->as<NativeObject>();
|
||||
|
||||
size_t span = shape->slotSpan();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue