Loading...
Searching...
No Matches
Public Member Functions | List of all members
v8::PropertyDescriptor Class Reference

#include <v8-object.h>

Public Member Functions

 PropertyDescriptor ()
 
 PropertyDescriptor (Local< Value > value)
 
 PropertyDescriptor (Local< Value > value, bool writable)
 
 PropertyDescriptor (Local< Value > get, Local< Value > set)
 
 ~PropertyDescriptor ()
 
Local< Valuevalue () const
 
bool has_value () const
 
Local< Valueget () const
 
bool has_get () const
 
Local< Valueset () const
 
bool has_set () const
 
void set_enumerable (bool enumerable)
 
bool enumerable () const
 
bool has_enumerable () const
 
void set_configurable (bool configurable)
 
bool configurable () const
 
bool has_configurable () const
 
bool writable () const
 
bool has_writable () const
 
PrivateData * get_private () const
 
 PropertyDescriptor (const PropertyDescriptor &)=delete
 
void operator= (const PropertyDescriptor &)=delete
 

Detailed Description

An instance of a Property Descriptor, see Ecma-262 6.2.4.

Properties in a descriptor are present or absent. If you do not set enumerable, configurable, and writable, they are absent. If value, get, or set are absent, but you must specify them in the constructor, use empty handles.

Accessors get and set must be callable or undefined if they are present.

Note
Only query properties if they are present, i.e., call x() only if has_x() returns true.
// var desc = {writable: false}
d.value(); // error, value not set
if (d.has_writable()) {
d.writable(); // false
}
// var desc = {value: undefined}
// var desc = {get: undefined}
Definition: v8-local-handle.h:258
Definition: v8-object.h:91
Local< Value > value() const
Local< Primitive > Undefined(Isolate *isolate)
Definition: v8-primitive.h:839

Constructor & Destructor Documentation

◆ PropertyDescriptor() [1/5]

v8::PropertyDescriptor::PropertyDescriptor ( )

◆ PropertyDescriptor() [2/5]

v8::PropertyDescriptor::PropertyDescriptor ( Local< Value value)
explicit

◆ PropertyDescriptor() [3/5]

v8::PropertyDescriptor::PropertyDescriptor ( Local< Value value,
bool  writable 
)

◆ PropertyDescriptor() [4/5]

v8::PropertyDescriptor::PropertyDescriptor ( Local< Value get,
Local< Value set 
)

◆ ~PropertyDescriptor()

v8::PropertyDescriptor::~PropertyDescriptor ( )

◆ PropertyDescriptor() [5/5]

v8::PropertyDescriptor::PropertyDescriptor ( const PropertyDescriptor )
delete

Member Function Documentation

◆ configurable()

bool v8::PropertyDescriptor::configurable ( ) const

◆ enumerable()

bool v8::PropertyDescriptor::enumerable ( ) const

◆ get()

Local< Value > v8::PropertyDescriptor::get ( ) const

◆ get_private()

PrivateData * v8::PropertyDescriptor::get_private ( ) const
inline

◆ has_configurable()

bool v8::PropertyDescriptor::has_configurable ( ) const

◆ has_enumerable()

bool v8::PropertyDescriptor::has_enumerable ( ) const

◆ has_get()

bool v8::PropertyDescriptor::has_get ( ) const

◆ has_set()

bool v8::PropertyDescriptor::has_set ( ) const

◆ has_value()

bool v8::PropertyDescriptor::has_value ( ) const

◆ has_writable()

bool v8::PropertyDescriptor::has_writable ( ) const

◆ operator=()

void v8::PropertyDescriptor::operator= ( const PropertyDescriptor )
delete

◆ set()

Local< Value > v8::PropertyDescriptor::set ( ) const

◆ set_configurable()

void v8::PropertyDescriptor::set_configurable ( bool  configurable)

◆ set_enumerable()

void v8::PropertyDescriptor::set_enumerable ( bool  enumerable)

◆ value()

Local< Value > v8::PropertyDescriptor::value ( ) const

◆ writable()

bool v8::PropertyDescriptor::writable ( ) const

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