v8  4.5.103 (node 4.8.7)
V8 is Google's open source JavaScript engine
MaybeLocal< T > Class Template Reference

#include <v8.h>

Public Member Functions

V8_INLINE MaybeLocal ()
 
template<class S >
V8_INLINE MaybeLocal (Local< S > that)
 
V8_INLINE bool IsEmpty () const
 
template<class S >
V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal (Local< S > *out) const
 
V8_INLINE Local< T > ToLocalChecked ()
 
template<class S >
V8_INLINE Local< S > FromMaybe (Local< S > default_value) const
 

Detailed Description

template<class T>
class v8::MaybeLocal< T >

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.

Definition at line 351 of file v8.h.

Constructor & Destructor Documentation

◆ MaybeLocal() [1/2]

V8_INLINE MaybeLocal ( )
inline

Definition at line 353 of file v8.h.

◆ MaybeLocal() [2/2]

V8_INLINE MaybeLocal ( Local< S >  that)
inline

Definition at line 355 of file v8.h.

Member Function Documentation

◆ FromMaybe()

V8_INLINE Local<S> FromMaybe ( Local< S >  default_value) const
inline

Definition at line 372 of file v8.h.

References MaybeLocal< T >::IsEmpty(), and Local< T >::Local.

◆ IsEmpty()

V8_INLINE bool IsEmpty ( ) const
inline

Definition at line 360 of file v8.h.

Referenced by MaybeLocal< T >::FromMaybe(), and MaybeLocal< T >::ToLocal().

◆ ToLocal()

V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal ( Local< S > *  out) const
inline

Definition at line 363 of file v8.h.

References MaybeLocal< T >::IsEmpty().

◆ ToLocalChecked()

Local< T > ToLocalChecked

Definition at line 7131 of file v8.h.

References Local< T >::Local.

Referenced by Template::Set().


The documentation for this class was generated from the following file: