v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::PropertyDescriptor Class Reference

#include <v8-object.h>

Collaboration diagram for v8::PropertyDescriptor:

Classes

struct  PrivateData
 

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
 
PrivateDataget_private () const
 
 PropertyDescriptor (const PropertyDescriptor &)=delete
 
void operator= (const PropertyDescriptor &)=delete
 

Private Attributes

PrivateDataprivate_
 

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}
Local< Value > value() const
Definition api.cc:4435
V8_INLINE Local< Primitive > Undefined(Isolate *isolate)

Definition at line 91 of file v8-object.h.

Constructor & Destructor Documentation

◆ PropertyDescriptor() [1/5]

v8::PropertyDescriptor::PropertyDescriptor ( )

Definition at line 4405 of file api.cc.

◆ PropertyDescriptor() [2/5]

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

Definition at line 4408 of file api.cc.

Here is the call graph for this function:

◆ PropertyDescriptor() [3/5]

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

Definition at line 4415 of file api.cc.

Here is the call graph for this function:

◆ PropertyDescriptor() [4/5]

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

Definition at line 4424 of file api.cc.

Here is the call graph for this function:

◆ ~PropertyDescriptor()

v8::PropertyDescriptor::~PropertyDescriptor ( )

Definition at line 4433 of file api.cc.

◆ PropertyDescriptor() [5/5]

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

Member Function Documentation

◆ configurable()

bool v8::PropertyDescriptor::configurable ( ) const

Definition at line 4486 of file api.cc.

◆ enumerable()

bool v8::PropertyDescriptor::enumerable ( ) const

Definition at line 4473 of file api.cc.

◆ get()

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

Definition at line 4440 of file api.cc.

◆ get_private()

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

Definition at line 127 of file v8-object.h.

Here is the caller graph for this function:

◆ has_configurable()

bool v8::PropertyDescriptor::has_configurable ( ) const

Definition at line 4491 of file api.cc.

◆ has_enumerable()

bool v8::PropertyDescriptor::has_enumerable ( ) const

Definition at line 4478 of file api.cc.

◆ has_get()

bool v8::PropertyDescriptor::has_get ( ) const

Definition at line 4453 of file api.cc.

◆ has_set()

bool v8::PropertyDescriptor::has_set ( ) const

Definition at line 4456 of file api.cc.

◆ has_value()

bool v8::PropertyDescriptor::has_value ( ) const

Definition at line 4450 of file api.cc.

◆ has_writable()

bool v8::PropertyDescriptor::has_writable ( ) const

Definition at line 4465 of file api.cc.

◆ operator=()

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

◆ set()

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

Definition at line 4445 of file api.cc.

◆ set_configurable()

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

Definition at line 4482 of file api.cc.

◆ set_enumerable()

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

Definition at line 4469 of file api.cc.

◆ value()

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

Definition at line 4435 of file api.cc.

◆ writable()

bool v8::PropertyDescriptor::writable ( ) const

Definition at line 4460 of file api.cc.

Here is the caller graph for this function:

Member Data Documentation

◆ private_

PrivateData* v8::PropertyDescriptor::private_
private

Definition at line 133 of file v8-object.h.


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