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

#include <v8-template.h>

Public Member Functions

V8_WARN_UNUSED_RESULT Local< ObjectNewInstance (Local< Context > context, MemorySpan< MaybeLocal< Value > > property_values)
 

Static Public Member Functions

static Local< DictionaryTemplateNew (Isolate *isolate, MemorySpan< const std::string_view > names)
 
static V8_INLINE DictionaryTemplateCast (Data *data)
 

Detailed Description

A template to create dictionary objects at runtime.

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

Member Function Documentation

◆ Cast()

DictionaryTemplate * Cast ( Data data)
static

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

◆ New()

static Local< DictionaryTemplate > New ( Isolate isolate,
MemorySpan< const std::string_view >  names 
)
static

Creates a new template. Also declares data properties that can be passed on instantiation of the template. Properties can only be declared on construction and are then immutable. The values are passed on creating the object via NewInstance().

Parameters
namesthe keys that can be passed on instantiation.

◆ NewInstance()

V8_WARN_UNUSED_RESULT Local< Object > NewInstance ( Local< Context context,
MemorySpan< MaybeLocal< Value > >  property_values 
)

Creates a new instance of this template.

Parameters
contextThe context used to create the dictionary object.
property_valuesValues of properties that were declared using DeclareDataProperties(). The span only passes values and expectes the order to match the declaration. Non-existent properties are signaled via empty MaybeLocals.

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