Copy as Markdown

Other Tools

/* THIS FILE IS AUTOGENERATED FROM NetErrorInfo.webidl BY Codegen.py - DO NOT EDIT */
#include <type_traits>
#include "AtomList.h"
#include "MainThreadUtils.h"
#include "NetErrorInfoBinding.h"
#include "js/CallAndConstruct.h"
#include "js/Exception.h"
#include "js/MapAndSet.h"
#include "js/Object.h"
#include "js/PropertyAndElement.h"
#include "js/PropertyDescriptor.h"
#include "js/experimental/JitInfo.h"
#include "mozilla/OwningNonNull.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/NonRefcountedDOMObject.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/SimpleGlobalObject.h"
namespace mozilla::dom {
namespace binding_detail {}; // Just to make sure it's known as a namespace
using namespace mozilla::dom::binding_detail;
NetErrorInfo::NetErrorInfo()
{
// Safe to pass a null context if we pass a null value
Init();
}
bool
NetErrorInfo::InitIds(JSContext* cx, NetErrorInfoAtoms* atomsCache)
{
MOZ_ASSERT(reinterpret_cast<jsid*>(atomsCache)->isVoid());
// Initialize these in reverse order so that any failure leaves the first one
// uninitialized.
if (!atomsCache->errorCodeString_id.init(cx, "errorCodeString")) {
return false;
}
return true;
}
bool
NetErrorInfo::Init(const char* sourceDescription, bool passedToJSImpl)
{
{
// scope for any temporaries our default value setting needs.
mErrorCodeString.AssignLiteral(u"");
}
mIsAnyMemberPresent = true;
return true;
}
bool
NetErrorInfo::ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const
{
NetErrorInfoAtoms* atomsCache = GetAtomCache<NetErrorInfoAtoms>(cx);
if (reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
!InitIds(cx, atomsCache)) {
return false;
}
JS::Rooted<JSObject*> obj(cx, JS_NewPlainObject(cx));
if (!obj) {
return false;
}
rval.set(JS::ObjectValue(*obj));
do {
// block for our 'break' successCode and scope for 'temp' and 'currentValue'
JS::Rooted<JS::Value> temp(cx);
nsString const & currentValue = mErrorCodeString;
if (!xpc::NonVoidStringToJsval(cx, currentValue, &temp)) {
return false;
}
if (!JS_DefinePropertyById(cx, obj, atomsCache->errorCodeString_id, temp, JSPROP_ENUMERATE)) {
return false;
}
break;
} while(false);
return true;
}
void
NetErrorInfo::TraceDictionary(JSTracer* trc)
{
}
NetErrorInfo&
NetErrorInfo::operator=(const NetErrorInfo& aOther)
{
DictionaryBase::operator=(aOther);
mErrorCodeString = aOther.mErrorCodeString;
return *this;
}
bool
NetErrorInfo::operator==(const NetErrorInfo& aOther) const
{
if (mErrorCodeString != aOther.mErrorCodeString) {
return false;
}
return true;
}
} // namespace mozilla::dom