5#ifndef INCLUDE_V8_TEMPLATE_H_
6#define INCLUDE_V8_TEMPLATE_H_
21class FunctionTemplate;
27#define V8_INTRINSICS_LIST(F) \
28 F(ArrayProto_entries, array_entries_iterator) \
29 F(ArrayProto_forEach, array_for_each_iterator) \
30 F(ArrayProto_keys, array_keys_iterator) \
31 F(ArrayProto_values, array_values_iterator) \
32 F(ArrayPrototype, initial_array_prototype) \
33 F(AsyncIteratorPrototype, initial_async_iterator_prototype) \
34 F(ErrorPrototype, initial_error_prototype) \
35 F(IteratorPrototype, initial_iterator_prototype) \
36 F(MapIteratorPrototype, initial_map_iterator_prototype) \
37 F(ObjProto_valueOf, object_value_of_function) \
38 F(SetIteratorPrototype, initial_set_iterator_prototype)
41#define V8_DECL_INTRINSIC(name, iname) k##name,
43#undef V8_DECL_INTRINSIC
56 void Set(Local<Name> name, Local<Data> value,
63 void SetAccessorProperty(
83 V8_DEPRECATED(
"Use SetNativeDataProperty without AccessControl instead")
84 void SetNativeDataProperty(
91 void SetNativeDataProperty(
98 void SetNativeDataProperty(
104 void SetNativeDataProperty(
115 void SetLazyDataProperty(
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 SetAcceptAnyReceiver(
bool value);
669 void ReadOnlyPrototype();
675 void RemovePrototype();
681 bool HasInstance(Local<Value>
object);
692 V8_INLINE static FunctionTemplate* Cast(Data* data);
697 static void CheckCast(
Data* that);
745 static_cast<int>(flags) |
747 PropertyHandlerFlags::kInternalNewCallbacksSignatures));
761 : getter(reinterpret_cast<void*>(getter)),
762 setter(reinterpret_cast<void*>(setter)),
763 query(reinterpret_cast<void*>(query)),
764 deleter(reinterpret_cast<void*>(deleter)),
765 enumerator(enumerator),
766 definer(reinterpret_cast<void*>(definer)),
767 descriptor(reinterpret_cast<void*>(descriptor)),
769 flags(WithNewSignatureFlag(flags)) {}
772 "Provide interceptor callbacks with new signatures instead "
773 "(NamedPropertyXxxCallback)")
784 : getter(reinterpret_cast<
void*>(getter)),
785 setter(reinterpret_cast<
void*>(setter)),
786 query(reinterpret_cast<
void*>(query)),
787 deleter(reinterpret_cast<
void*>(deleter)),
788 enumerator(enumerator),
789 definer(reinterpret_cast<
void*>(definer)),
790 descriptor(reinterpret_cast<
void*>(descriptor)),
802 : getter(reinterpret_cast<void*>(getter)),
803 setter(reinterpret_cast<void*>(setter)),
804 query(reinterpret_cast<void*>(query)),
805 deleter(reinterpret_cast<void*>(deleter)),
806 enumerator(enumerator),
810 flags(WithNewSignatureFlag(flags)) {}
813 "Provide interceptor callbacks with new signatures instead "
814 "(NamedPropertyXxxCallback)")
823 : getter(reinterpret_cast<
void*>(getter)),
824 setter(reinterpret_cast<
void*>(setter)),
825 query(reinterpret_cast<
void*>(query)),
826 deleter(reinterpret_cast<
void*>(deleter)),
827 enumerator(enumerator),
842 : getter(reinterpret_cast<void*>(getter)),
843 setter(reinterpret_cast<void*>(setter)),
845 deleter(reinterpret_cast<void*>(deleter)),
846 enumerator(enumerator),
847 definer(reinterpret_cast<void*>(definer)),
848 descriptor(reinterpret_cast<void*>(descriptor)),
850 flags(WithNewSignatureFlag(flags)) {}
853 "Provide interceptor callbacks with new signatures instead "
854 "(NamedPropertyXxxCallback)")
864 : getter(reinterpret_cast<
void*>(getter)),
865 setter(reinterpret_cast<
void*>(setter)),
867 deleter(reinterpret_cast<
void*>(deleter)),
868 enumerator(enumerator),
869 definer(reinterpret_cast<
void*>(definer)),
870 descriptor(reinterpret_cast<
void*>(descriptor)),
890 static_cast<int>(flags) |
892 PropertyHandlerFlags::kInternalNewCallbacksSignatures));
906 : getter(reinterpret_cast<void*>(getter)),
907 setter(reinterpret_cast<void*>(setter)),
908 query(reinterpret_cast<void*>(query)),
909 deleter(reinterpret_cast<void*>(deleter)),
910 enumerator(enumerator),
911 definer(reinterpret_cast<void*>(definer)),
912 descriptor(reinterpret_cast<void*>(descriptor)),
914 flags(WithNewSignatureFlag(flags)) {}
917 "Provide interceptor callbacks with new signatures instead "
918 "(IndexedPropertyXxxCallbackV2)")
929 : getter(reinterpret_cast<
void*>(getter)),
930 setter(reinterpret_cast<
void*>(setter)),
931 query(reinterpret_cast<
void*>(query)),
932 deleter(reinterpret_cast<
void*>(deleter)),
933 enumerator(enumerator),
934 definer(reinterpret_cast<
void*>(definer)),
935 descriptor(reinterpret_cast<
void*>(descriptor)),
947 : getter(reinterpret_cast<void*>(getter)),
948 setter(reinterpret_cast<void*>(setter)),
949 query(reinterpret_cast<void*>(query)),
950 deleter(reinterpret_cast<void*>(deleter)),
951 enumerator(enumerator),
955 flags(WithNewSignatureFlag(flags)) {}
958 "Provide interceptor callbacks with new signatures instead "
959 "(IndexedPropertyXxxCallbackV2)")
968 : getter(reinterpret_cast<
void*>(getter)),
969 setter(reinterpret_cast<
void*>(setter)),
970 query(reinterpret_cast<
void*>(query)),
971 deleter(reinterpret_cast<
void*>(deleter)),
972 enumerator(enumerator),
987 : getter(reinterpret_cast<void*>(getter)),
988 setter(reinterpret_cast<void*>(setter)),
990 deleter(reinterpret_cast<void*>(deleter)),
991 enumerator(enumerator),
992 definer(reinterpret_cast<void*>(definer)),
993 descriptor(reinterpret_cast<void*>(descriptor)),
995 flags(WithNewSignatureFlag(flags)) {}
998 "Provide interceptor callbacks with new signatures instead "
999 "(IndexedPropertyXxxCallbackV2)")
1009 : getter(reinterpret_cast<
void*>(getter)),
1010 setter(reinterpret_cast<
void*>(setter)),
1012 deleter(reinterpret_cast<
void*>(deleter)),
1013 enumerator(enumerator),
1014 definer(reinterpret_cast<
void*>(definer)),
1015 descriptor(reinterpret_cast<
void*>(descriptor)),
1110 void SetIndexedPropertyHandler(
1118 deleter, enumerator, data));
1150 void MarkAsUndetectable();
1169 void SetAccessCheckCallbackAndHandler(
1179 int InternalFieldCount()
const;
1185 void SetInternalFieldCount(
int value);
1190 bool IsImmutableProto()
const;
1196 void SetImmutableProto();
1208 bool IsCodeLike()
const;
1249 static void CheckCast(
Data* that);
1262class V8_EXPORT Signature :
public Data {
1273 static void CheckCast(
Data* that);
1280 Set(String::NewFromUtf8(isolate, name, NewStringType::kInternalized)
1286#ifdef V8_ENABLE_CHECKS
1293#ifdef V8_ENABLE_CHECKS
1300#ifdef V8_ENABLE_CHECKS
1307#ifdef V8_ENABLE_CHECKS
1310 return reinterpret_cast<Signature*
>(data);
Definition: v8-context.h:48
Definition: v8-template.h:1221
Definition: v8-template.h:569
Definition: v8-isolate.h:210
Definition: v8-local-handle.h:258
Definition: v8-local-handle.h:619
Definition: v8-memory-span.h:29
Definition: v8-primitive.h:79
Definition: v8-template.h:1035
Definition: v8-function-callback.h:192
Definition: v8-object.h:91
Definition: v8-container.h:148
Definition: v8-template.h:1261
Definition: v8-primitive.h:124
Definition: v8-template.h:48
Definition: v8-value.h:32
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:159
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:203
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
AccessControl
Definition: v8-object.h:177
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:40
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:308
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
void(*)(Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info) AccessorSetterCallback
Definition: v8-object.h:164
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:167
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
void(*)(Local< String > property, const PropertyCallbackInfo< Value > &info) AccessorGetterCallback
Definition: v8-object.h:157
PropertyHandlerFlags
Definition: v8-template.h:705
@ kInternalNewCallbacksSignatures
Intercepted
Definition: v8-template.h:138
Definition: v8-template.h:884
Definition: v8-template.h:739
#define V8_INTRINSICS_LIST(F)
Definition: v8-template.h:27
#define V8_DECL_INTRINSIC(name, iname)
Definition: v8-template.h:41
#define V8_EXPORT
Definition: v8config.h:762
#define V8_INLINE
Definition: v8config.h:477
#define V8_DEPRECATE_SOON(message)
Definition: v8config.h:580
#define V8_DEPRECATED(message)
Definition: v8config.h:572
#define V8_WARN_UNUSED_RESULT
Definition: v8config.h:637