18 #ifndef INCLUDED_SCRIPTVAL 19 #define INCLUDED_SCRIPTVAL 42 m_Val.reset(
new JS::PersistentRooted<T>(rt));
47 m_Val.reset(
new JS::PersistentRooted<T>(rt, val));
52 m_Val.reset(
new JS::PersistentRooted<T>(cx, val));
62 return m_Val ==
nullptr;
65 inline JS::PersistentRooted<T>&
get()
const 71 inline void set(JSRuntime* rt,
T val)
73 m_Val.reset(
new JS::PersistentRooted<T>(rt, val));
76 inline void set(JSContext* cx,
T val)
78 m_Val.reset(
new JS::PersistentRooted<T>(cx, val));
87 m_Val = std::move(other.m_Val);
93 m_Val = std::move(other.m_Val);
97 std::unique_ptr<JS::PersistentRooted<T> >
m_Val;
100 #endif // INCLUDED_SCRIPTVAL
DefPersistentRooted< T > & operator=(DefPersistentRooted< T > &&other)
Definition: ScriptVal.h:85
DefPersistentRooted(JSRuntime *rt)
Definition: ScriptVal.h:40
A default constructible wrapper around JS::PersistentRootedValue.
Definition: ScriptVal.h:33
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
Definition: debug.h:287
#define T(string_literal)
Definition: secure_crt.cpp:76
DefPersistentRooted(JSRuntime *rt, JS::HandleValue val)
Definition: ScriptVal.h:45
void clear()
Definition: ScriptVal.h:55
DefPersistentRooted(JSContext *cx, JS::Handle< T > val)
Definition: ScriptVal.h:50
std::unique_ptr< JS::PersistentRooted< T > > m_Val
Definition: ScriptVal.h:97
bool uninitialized()
Definition: ScriptVal.h:60
DefPersistentRooted()
Definition: ScriptVal.h:36