v8 12.4.254 (node 22.4.1)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
Template Class Reference

#include <v8-template.h>

Inheritance diagram for Template:
Collaboration diagram for Template:

Public Member Functions

void Set (Local< Name > name, Local< Data > value, PropertyAttribute attributes=None)
 
void SetPrivate (Local< Private > name, Local< Data > value, PropertyAttribute attributes=None)
 
V8_INLINE void Set (Isolate *isolate, const char *name, Local< Data > value, PropertyAttribute attributes=None)
 
void SetAccessorProperty (Local< Name > name, Local< FunctionTemplate > getter=Local< FunctionTemplate >(), Local< FunctionTemplate > setter=Local< FunctionTemplate >(), PropertyAttribute attribute=None)
 
void SetNativeDataProperty (Local< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter, Local< Value > data, PropertyAttribute attribute, AccessControl settings, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
 
void SetNativeDataProperty (Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter, Local< Value > data, PropertyAttribute attribute, AccessControl settings, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
 
void SetNativeDataProperty (Local< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=nullptr, Local< Value > data=Local< Value >(), PropertyAttribute attribute=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
 
void SetNativeDataProperty (Local< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=nullptr, Local< Value > data=Local< Value >(), PropertyAttribute attribute=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
 
void SetLazyDataProperty (Local< Name > name, AccessorNameGetterCallback getter, Local< Value > data=Local< Value >(), PropertyAttribute attribute=None, SideEffectType getter_side_effect_type=SideEffectType::kHasSideEffect, SideEffectType setter_side_effect_type=SideEffectType::kHasSideEffect)
 
void SetIntrinsicDataProperty (Local< Name > name, Intrinsic intrinsic, PropertyAttribute attribute=None)
 
- Public Member Functions inherited from Data
bool IsValue () const
 
bool IsModule () const
 
bool IsFixedArray () const
 
bool IsPrivate () const
 
bool IsObjectTemplate () const
 
bool IsFunctionTemplate () const
 
bool IsContext () const
 

Friends

class ObjectTemplate
 
class FunctionTemplate
 

Detailed Description

The superclass of object and function templates.

Definition at line 49 of file v8-template.h.

Member Function Documentation

◆ Set() [1/2]

void Set ( Isolate isolate,
const char *  name,
Local< Data value,
PropertyAttribute  attributes = None 
)

Definition at line 1260 of file v8-template.h.

◆ Set() [2/2]

void Set ( Local< Name name,
Local< Data value,
PropertyAttribute  attributes = None 
)

Adds a property to each instance created by this template.

The property must be defined either as a primitive value, or a template.

◆ SetAccessorProperty()

void SetAccessorProperty ( Local< Name name,
Local< FunctionTemplate getter = LocalFunctionTemplate >(),
Local< FunctionTemplate setter = LocalFunctionTemplate >(),
PropertyAttribute  attribute = None 
)

◆ SetIntrinsicDataProperty()

void SetIntrinsicDataProperty ( Local< Name name,
Intrinsic  intrinsic,
PropertyAttribute  attribute = None 
)

During template instantiation, sets the value with the intrinsic property from the correct context.

◆ SetLazyDataProperty()

void SetLazyDataProperty ( Local< Name name,
AccessorNameGetterCallback  getter,
Local< Value data = LocalValue >(),
PropertyAttribute  attribute = None,
SideEffectType  getter_side_effect_type = SideEffectType::kHasSideEffect,
SideEffectType  setter_side_effect_type = SideEffectType::kHasSideEffect 
)

Like SetNativeDataProperty, but V8 will replace the native data property with a real data property on first access.

◆ SetNativeDataProperty() [1/4]

void SetNativeDataProperty ( Local< Name name,
AccessorNameGetterCallback  getter,
AccessorNameSetterCallback  setter,
Local< Value data,
PropertyAttribute  attribute,
AccessControl  settings,
SideEffectType  getter_side_effect_type = SideEffectType::kHasSideEffect,
SideEffectType  setter_side_effect_type = SideEffectType::kHasSideEffect 
)

◆ SetNativeDataProperty() [2/4]

void SetNativeDataProperty ( Local< Name name,
AccessorNameGetterCallback  getter,
AccessorNameSetterCallback  setter = nullptr,
Local< Value data = LocalValue >(),
PropertyAttribute  attribute = None,
SideEffectType  getter_side_effect_type = SideEffectType::kHasSideEffect,
SideEffectType  setter_side_effect_type = SideEffectType::kHasSideEffect 
)

◆ SetNativeDataProperty() [3/4]

void SetNativeDataProperty ( Local< String name,
AccessorGetterCallback  getter,
AccessorSetterCallback  setter,
Local< Value data,
PropertyAttribute  attribute,
AccessControl  settings,
SideEffectType  getter_side_effect_type = SideEffectType::kHasSideEffect,
SideEffectType  setter_side_effect_type = SideEffectType::kHasSideEffect 
)

Whenever the property with the given name is accessed on objects created from this Template the getter and setter callbacks are called instead of getting and setting the property directly on the JavaScript object.

Parameters
nameThe name of the property for which an accessor is added.
getterThe callback to invoke when getting the property.
setterThe callback to invoke when setting the property.
dataA piece of data that will be passed to the getter and setter callbacks whenever they are invoked.
attributeThe attributes of the property for which an accessor is added.

◆ SetNativeDataProperty() [4/4]

void SetNativeDataProperty ( Local< String name,
AccessorGetterCallback  getter,
AccessorSetterCallback  setter = nullptr,
Local< Value data = LocalValue >(),
PropertyAttribute  attribute = None,
SideEffectType  getter_side_effect_type = SideEffectType::kHasSideEffect,
SideEffectType  setter_side_effect_type = SideEffectType::kHasSideEffect 
)

◆ SetPrivate()

void SetPrivate ( Local< Private name,
Local< Data value,
PropertyAttribute  attributes = None 
)

Friends And Related Symbol Documentation

◆ FunctionTemplate

friend class FunctionTemplate
friend

Definition at line 132 of file v8-template.h.

◆ ObjectTemplate

friend class ObjectTemplate
friend

Definition at line 131 of file v8-template.h.


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