v8  7.0.276 (node 11.14.0)
V8 is Google's open source JavaScript engine
PropertyDescriptor Class Reference

#include <v8.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}
v8::PropertyDescriptor d(Local<Value>()), false);
d.value(); // error, value not set
if (d.has_writable()) {
d.writable(); // false
}
// var desc = {value: undefined}
v8::PropertyDescriptor d(v8::Undefined(isolate));
// var desc = {get: undefined}
v8::PropertyDescriptor d(v8::Undefined(isolate), Local<Value>()));
Local< Value > value() const

Definition at line 4250 of file v8.h.

Constructor & Destructor Documentation

◆ PropertyDescriptor() [1/5]

◆ PropertyDescriptor() [2/5]

◆ PropertyDescriptor() [3/5]

PropertyDescriptor ( Local< Value value,
bool  writable 
)

◆ PropertyDescriptor() [4/5]

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

◆ ~PropertyDescriptor()

◆ PropertyDescriptor() [5/5]

PropertyDescriptor ( const PropertyDescriptor )
delete

Member Function Documentation

◆ configurable()

bool configurable ( ) const

◆ enumerable()

bool enumerable ( ) const

◆ get()

Local<Value> get ( ) const

◆ get_private()

PrivateData* get_private ( ) const
inline

Definition at line 4286 of file v8.h.

◆ has_configurable()

bool has_configurable ( ) const

◆ has_enumerable()

bool has_enumerable ( ) const

◆ has_get()

bool has_get ( ) const

◆ has_set()

bool has_set ( ) const

◆ has_value()

bool has_value ( ) const

◆ has_writable()

bool has_writable ( ) const

◆ operator=()

void operator= ( const PropertyDescriptor )
delete

◆ set()

Local<Value> set ( ) const

◆ set_configurable()

void set_configurable ( bool  configurable)

◆ set_enumerable()

void set_enumerable ( bool  enumerable)

◆ value()

Local<Value> value ( ) const

◆ writable()

bool writable ( ) const

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