5#ifndef INCLUDE_V8_TEMPLATE_H_
6#define INCLUDE_V8_TEMPLATE_H_
22class FunctionTemplate;
28#define V8_INTRINSICS_LIST(F) \
29 F(ArrayProto_entries, array_entries_iterator) \
30 F(ArrayProto_forEach, array_for_each_iterator) \
31 F(ArrayProto_keys, array_keys_iterator) \
32 F(ArrayProto_values, array_values_iterator) \
33 F(ArrayPrototype, initial_array_prototype) \
34 F(AsyncIteratorPrototype, initial_async_iterator_prototype) \
35 F(ErrorPrototype, initial_error_prototype) \
36 F(IteratorPrototype, initial_iterator_prototype) \
37 F(MapIteratorPrototype, initial_map_iterator_prototype) \
38 F(ObjProto_valueOf, object_value_of_function) \
39 F(SetIteratorPrototype, initial_set_iterator_prototype)
42#define V8_DECL_INTRINSIC(name, iname) k##name,
44#undef V8_DECL_INTRINSIC
57 void Set(Local<Name> name, Local<Data> value,
78 void SetAccessorProperty(
104 void SetNativeDataProperty(
108 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
109 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
115 void SetLazyDataProperty(
118 SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
119 SideEffectType setter_side_effect_type = SideEffectType::kHasSideEffect);
185 Local<Name> property,
const PropertyCallbackInfo<Value>& info);
570class V8_EXPORT FunctionTemplate :
public Template {
573 static Local<FunctionTemplate> New(
574 Isolate* isolate, FunctionCallback callback =
nullptr,
575 Local<Value> data = Local<Value>(),
576 Local<Signature> signature = Local<Signature>(),
int length = 0,
577 ConstructorBehavior behavior = ConstructorBehavior::kAllow,
578 SideEffectType side_effect_type = SideEffectType::kHasSideEffect,
579 const CFunction* c_function =
nullptr, uint16_t instance_type = 0,
580 uint16_t allowed_receiver_instance_type_range_start = 0,
581 uint16_t allowed_receiver_instance_type_range_end = 0);
584 static Local<FunctionTemplate> NewWithCFunctionOverloads(
585 Isolate* isolate, FunctionCallback callback =
nullptr,
586 Local<Value> data = Local<Value>(),
587 Local<Signature> signature = Local<Signature>(),
int length = 0,
588 ConstructorBehavior behavior = ConstructorBehavior::kAllow,
589 SideEffectType side_effect_type = SideEffectType::kHasSideEffect,
590 const MemorySpan<const CFunction>& c_function_overloads = {});
595 static Local<FunctionTemplate> NewWithCache(
596 Isolate* isolate, FunctionCallback callback,
597 Local<Private> cache_property, Local<Value> data = Local<Value>(),
598 Local<Signature> signature = Local<Signature>(),
int length = 0,
599 SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
603 Local<Context> context);
621 FunctionCallback callback, Local<Value> data = Local<Value>(),
622 SideEffectType side_effect_type = SideEffectType::kHasSideEffect,
623 const MemorySpan<const CFunction>& c_function_overloads = {});
626 void SetLength(
int length);
629 Local<ObjectTemplate> InstanceTemplate();
636 void Inherit(Local<FunctionTemplate> parent);
642 Local<ObjectTemplate> PrototypeTemplate();
650 void SetPrototypeProviderTemplate(Local<FunctionTemplate> prototype_provider);
657 void SetClassName(Local<String> name);
663 void SetInterfaceName(Local<String> name);
669 void SetExceptionContext(ExceptionContext context);
675 void SetAcceptAnyReceiver(
bool value);
681 void ReadOnlyPrototype();
687 void RemovePrototype();
693 bool HasInstance(Local<Value>
object);
704 V8_INLINE static FunctionTemplate* Cast(Data* data);
709 static void CheckCast(
Data* that);
757 static_cast<int>(
flags) |
836 static_cast<int>(
flags) |
972 void MarkAsUndetectable();
991 void SetAccessCheckCallbackAndHandler(
1001 int InternalFieldCount()
const;
1007 void SetInternalFieldCount(
int value);
1012 bool IsImmutableProto()
const;
1018 void SetImmutableProto();
1030 bool IsCodeLike()
const;
1071 static void CheckCast(
Data* that);
1084class V8_EXPORT Signature :
public Data {
1095 static void CheckCast(
Data* that);
1108#ifdef V8_ENABLE_CHECKS
1115#ifdef V8_ENABLE_CHECKS
1122#ifdef V8_ENABLE_CHECKS
1129#ifdef V8_ENABLE_CHECKS
1132 return reinterpret_cast<Signature*
>(data);
Definition: v8-context.h:48
Definition: v8-template.h:1043
static DictionaryTemplate * Cast(Data *data)
Definition: v8-template.h:1120
Definition: v8-template.h:569
static FunctionTemplate * Cast(Data *data)
Definition: v8-template.h:1106
Definition: v8-isolate.h:212
Definition: v8-local-handle.h:266
Definition: v8-local-handle.h:632
Definition: v8-memory-span.h:63
Definition: v8-template.h:915
static ObjectTemplate * Cast(Data *data)
Definition: v8-template.h:1113
Definition: v8-function-callback.h:206
Definition: v8-object.h:91
Definition: v8-container.h:148
Definition: v8-template.h:1083
static Signature * Cast(Data *data)
Definition: v8-template.h:1127
static MaybeLocal< String > NewFromUtf8(Isolate *isolate, const char *data, NewStringType type=NewStringType::kNormal, int length=-1)
Definition: v8-template.h:49
void Set(Local< Name > name, Local< Data > value, PropertyAttribute attributes=None)
Definition: libplatform.h:15
void(*)(uint32_t index, const PropertyCallbackInfo< Integer > &info) IndexedPropertyQueryCallback
Definition: v8-template.h:412
PropertyAttribute
Definition: v8-object.h:139
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) AccessorNameGetterCallback
Definition: v8-object.h:156
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyGetterCallback
Definition: v8-template.h:191
Intercepted(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) NamedPropertySetterCallback
Definition: v8-template.h:214
void(*)(Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyDefinerCallback
Definition: v8-template.h:345
void(*)(uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) IndexedPropertyDefinerCallback
Definition: v8-template.h:441
void(*)(uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info) IndexedPropertySetterCallback
Definition: v8-template.h:403
SideEffectType
Definition: v8-object.h:198
Intercepted(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) NamedPropertyDescriptorCallback
Definition: v8-template.h:372
void(*)(uint32_t index, const PropertyCallbackInfo< Boolean > &info) IndexedPropertyDeleterCallback
Definition: v8-template.h:421
Intercepted(*)(uint32_t index, Local< Value > value, const PropertyCallbackInfo< void > &info) IndexedPropertySetterCallbackV2
Definition: v8-template.h:399
Intercepted(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) NamedPropertyGetterCallback
Definition: v8-template.h:184
NamedPropertyEnumeratorCallback GenericNamedPropertyEnumeratorCallback
Definition: v8-template.h:311
void(*)(Local< Name > property, const PropertyCallbackInfo< Integer > &info) GenericNamedPropertyQueryCallback
Definition: v8-template.h:262
Intercepted(*)(Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< void > &info) NamedPropertyDefinerCallback
Definition: v8-template.h:334
void(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyDescriptorCallback
Definition: v8-template.h:450
Intrinsic
Definition: v8-template.h:41
void(*)(const PropertyCallbackInfo< Array > &info) NamedPropertyEnumeratorCallback
Definition: v8-template.h:308
ConstructorBehavior
Definition: v8-template.h:460
void(*)(const FunctionCallbackInfo< Value > &info) FunctionCallback
Definition: v8-function-callback.h:333
Intercepted(*)(uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< void > &info) IndexedPropertyDefinerCallbackV2
Definition: v8-template.h:437
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Boolean > &info) IndexedPropertyDeleterCallbackV2
Definition: v8-template.h:418
void(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyGetterCallback
Definition: v8-template.h:393
void(*)(const PropertyCallbackInfo< Array > &info) IndexedPropertyEnumeratorCallback
Definition: v8-template.h:430
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyDescriptorCallbackV2
Definition: v8-template.h:447
Intercepted(*)(Local< Name > property, const PropertyCallbackInfo< Integer > &info) NamedPropertyQueryCallback
Definition: v8-template.h:254
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) AccessorNameSetterCallback
Definition: v8-object.h:160
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< Value > &info) GenericNamedPropertySetterCallback
Definition: v8-template.h:225
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyGetterCallbackV2
Definition: v8-template.h:390
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyDescriptorCallback
Definition: v8-template.h:380
bool(*)(Local< Context > accessing_context, Local< Object > accessed_object, Local< Value > data) AccessCheckCallback
Definition: v8-template.h:458
Intercepted(*)(Local< Name > property, const PropertyCallbackInfo< Boolean > &info) NamedPropertyDeleterCallback
Definition: v8-template.h:289
void(*)(Local< Name > property, const PropertyCallbackInfo< Boolean > &info) GenericNamedPropertyDeleterCallback
Definition: v8-template.h:299
Intercepted(*)(uint32_t index, const PropertyCallbackInfo< Integer > &info) IndexedPropertyQueryCallbackV2
Definition: v8-template.h:409
PropertyHandlerFlags
Definition: v8-template.h:717
@ kInternalNewCallbacksSignatures
Intercepted
Definition: v8-template.h:138
Definition: v8-template.h:830
PropertyHandlerFlags flags
Definition: v8-template.h:906
IndexedPropertyQueryCallbackV2 query
Definition: v8-template.h:900
IndexedPropertyDeleterCallbackV2 deleter
Definition: v8-template.h:901
IndexedPropertyGetterCallbackV2 getter
Definition: v8-template.h:898
IndexedPropertyEnumeratorCallback enumerator
Definition: v8-template.h:902
Local< Value > data
Definition: v8-template.h:905
IndexedPropertyDescriptorCallbackV2 descriptor
Definition: v8-template.h:904
IndexedPropertySetterCallbackV2 setter
Definition: v8-template.h:899
IndexedPropertyDefinerCallbackV2 definer
Definition: v8-template.h:903
Definition: v8-template.h:751
NamedPropertyDescriptorCallback descriptor
Definition: v8-template.h:825
Local< Value > data
Definition: v8-template.h:826
NamedPropertySetterCallback setter
Definition: v8-template.h:820
NamedPropertyDeleterCallback deleter
Definition: v8-template.h:822
NamedPropertyEnumeratorCallback enumerator
Definition: v8-template.h:823
NamedPropertyQueryCallback query
Definition: v8-template.h:821
NamedPropertyGetterCallback getter
Definition: v8-template.h:819
NamedPropertyDefinerCallback definer
Definition: v8-template.h:824
PropertyHandlerFlags flags
Definition: v8-template.h:827
#define V8_INTRINSICS_LIST(F)
Definition: v8-template.h:28
#define V8_DECL_INTRINSIC(name, iname)
Definition: v8-template.h:42
#define V8_EXPORT
Definition: v8config.h:793
#define V8_INLINE
Definition: v8config.h:499
#define V8_WARN_UNUSED_RESULT
Definition: v8config.h:660