v8 13.6.233 (node 24.1.0)
V8 is Google's open source JavaScript engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
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 1052 of file v8-template.h.

Member Function Documentation

◆ Cast()

DictionaryTemplate * Cast ( Data * data)
static

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

Referenced by NewInstance().

◆ 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.

References Cast(), V8_INLINE, and V8_WARN_UNUSED_RESULT.


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