v8  5.5.372(node7.10.1)
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}
// var desc = {get: undefined}
v8::PropertyDescriptor d(v8::Undefined(isolate), Local<Value>()));

Definition at line 3832 of file v8.h.

Constructor & Destructor Documentation

PropertyDescriptor ( Local< Value value,
bool  writable 
)
PropertyDescriptor ( Local< Value get,
Local< Value set 
)
PropertyDescriptor ( const PropertyDescriptor )
delete

Member Function Documentation

bool configurable ( ) const
bool enumerable ( ) const
Local<Value> get ( ) const
PrivateData* get_private ( ) const
inline

Definition at line 3868 of file v8.h.

bool has_configurable ( ) const
bool has_enumerable ( ) const
bool has_get ( ) const
bool has_set ( ) const
bool has_value ( ) const
bool has_writable ( ) const
void operator= ( const PropertyDescriptor )
delete
Local<Value> set ( ) const
void set_configurable ( bool  configurable)
void set_enumerable ( bool  enumerable)
Local<Value> value ( ) const
bool writable ( ) const

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