#include <v8-local-handle.h>
Public Member Functions | |
MaybeLocal () | |
template<class S > | |
MaybeLocal (Local< S > that) | |
bool | IsEmpty () const |
template<class S > | |
bool | ToLocal (Local< S > *out) const |
Local< T > | ToLocalChecked () |
template<class S > | |
Local< S > | FromMaybe (Local< S > default_value) const |
template<class S > | |
MaybeLocal< S > | As () const |
Static Public Member Functions | |
template<class S > | |
static MaybeLocal< T > | Cast (MaybeLocal< S > that) |
Friends | |
template<typename S > | |
class | MaybeLocal |
A MaybeLocal<> is a wrapper around Local<> that enforces a check whether the Local<> is empty before it can be used.
If an API method returns a MaybeLocal<>, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a TerminateExecution exception was thrown. In that case, an empty MaybeLocal is returned.
|
inline |
Calling this is equivalent to MaybeLocal<S>::Cast(). In particular, this is only valid if the handle actually refers to a value of the target type.
|
inlinestatic |
Cast a handle to a subclass, e.g. MaybeLocal<Value> to MaybeLocal<Object>. This is only valid if the handle actually refers to a value of the target type.
|
inline |
Converts this MaybeLocal<> to a Local<>, using a default value if this MaybeLocal<> is empty.
|
inline |
|
inline |
Converts this MaybeLocal<> to a Local<>. If this MaybeLocal<> is empty, |false| is returned and |out| is assigned with nullptr.
|
inline |
Converts this MaybeLocal<> to a Local<>. If this MaybeLocal<> is empty, V8 will crash the process.