5#ifndef INCLUDE_V8_TEMPLATE_H_
6#define INCLUDE_V8_TEMPLATE_H_
17class AccessorSignature;
19class FunctionTemplate;
25#define V8_INTRINSICS_LIST(F) \
26 F(ArrayProto_entries, array_entries_iterator) \
27 F(ArrayProto_forEach, array_for_each_iterator) \
28 F(ArrayProto_keys, array_keys_iterator) \
29 F(ArrayProto_values, array_values_iterator) \
30 F(ArrayPrototype, initial_array_prototype) \
31 F(AsyncIteratorPrototype, initial_async_iterator_prototype) \
32 F(ErrorPrototype, initial_error_prototype) \
33 F(IteratorPrototype, initial_iterator_prototype) \
34 F(ObjProto_valueOf, object_value_of_function)
37#define V8_DECL_INTRINSIC(name, iname) k##name,
39#undef V8_DECL_INTRINSIC
93 void SetNativeDataProperty(
101 void SetNativeDataProperty(
108 void SetNativeDataProperty(
115 void SetNativeDataProperty(
127 void SetLazyDataProperty(
490 const CFunction* c_function =
nullptr, uint16_t instance_type = 0,
491 uint16_t allowed_receiver_instance_type_range_start = 0,
492 uint16_t allowed_receiver_instance_type_range_end = 0);
510 SideEffectType side_effect_type = SideEffectType::kHasSideEffect);
608 static void CheckCast(
Data* that);
661 enumerator(enumerator),
663 descriptor(descriptor),
680 enumerator(enumerator),
699 enumerator(enumerator),
701 descriptor(descriptor),
730 enumerator(enumerator),
732 descriptor(descriptor),
749 enumerator(enumerator),
768 enumerator(enumerator),
770 descriptor(descriptor),
890 void SetIndexedPropertyHandler(
898 deleter, enumerator, data));
996 static void CheckCast(
Data* that);
1019 static void CheckCast(
Data* that);
1037 static void CheckCast(
Data* that);
1044 Set(String::NewFromUtf8(isolate, name, NewStringType::kInternalized)
1050#ifdef V8_ENABLE_CHECKS
1057#ifdef V8_ENABLE_CHECKS
1064#ifdef V8_ENABLE_CHECKS
1067 return reinterpret_cast<Signature*
>(data);
1071#ifdef V8_ENABLE_CHECKS
static Local< AccessorSignature > New(Isolate *isolate, Local< FunctionTemplate > receiver=Local< FunctionTemplate >())
bool HasInstance(Local< Value > object)
static Local< FunctionTemplate > New(Isolate *isolate, FunctionCallback callback=nullptr, Local< Value > data=Local< Value >(), Local< Signature > signature=Local< Signature >(), int length=0, ConstructorBehavior behavior=ConstructorBehavior::kAllow, SideEffectType side_effect_type=SideEffectType::kHasSideEffect, const CFunction *c_function=nullptr, uint16_t instance_type=0, uint16_t allowed_receiver_instance_type_range_start=0, uint16_t allowed_receiver_instance_type_range_end=0)
static Local< FunctionTemplate > NewWithCache(Isolate *isolate, FunctionCallback callback, Local< Private > cache_property, Local< Value > data=Local< Value >(), Local< Signature > signature=Local< Signature >(), int length=0, SideEffectType side_effect_type=SideEffectType::kHasSideEffect)
void SetCallHandler(FunctionCallback callback, Local< Value > data=Local< Value >(), SideEffectType side_effect_type=SideEffectType::kHasSideEffect, const MemorySpan< const CFunction > &c_function_overloads={})
static Local< FunctionTemplate > NewWithCFunctionOverloads(Isolate *isolate, FunctionCallback callback=nullptr, Local< Value > data=Local< Value >(), Local< Signature > signature=Local< Signature >(), int length=0, ConstructorBehavior behavior=ConstructorBehavior::kAllow, SideEffectType side_effect_type=SideEffectType::kHasSideEffect, const MemorySpan< const CFunction > &c_function_overloads={})
Local< ObjectTemplate > InstanceTemplate()
void SetLength(int length)
bool IsLeafTemplateForApiObject(v8::Local< v8::Value > value) const
Local< ObjectTemplate > PrototypeTemplate()
void Inherit(Local< FunctionTemplate > parent)
V8_WARN_UNUSED_RESULT MaybeLocal< Function > GetFunction(Local< Context > context)
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewRemoteInstance()
void SetPrototypeProviderTemplate(Local< FunctionTemplate > prototype_provider)
void SetClassName(Local< String > name)
void SetAcceptAnyReceiver(bool value)
void SetInternalFieldCount(int value)
static Local< ObjectTemplate > New(Isolate *isolate, Local< FunctionTemplate > constructor=Local< FunctionTemplate >())
void SetCallAsFunctionHandler(FunctionCallback callback, Local< Value > data=Local< Value >())
void MarkAsUndetectable()
void SetAccessCheckCallbackAndHandler(AccessCheckCallback callback, const NamedPropertyHandlerConfiguration &named_handler, const IndexedPropertyHandlerConfiguration &indexed_handler, Local< Value > data=Local< Value >())
void SetAccessCheckCallback(AccessCheckCallback callback, Local< Value > data=Local< Value >())
bool IsImmutableProto() const
void SetHandler(const IndexedPropertyHandlerConfiguration &configuration)
V8_WARN_UNUSED_RESULT MaybeLocal< Object > NewInstance(Local< Context > context)
int InternalFieldCount() const
static Local< Signature > New(Isolate *isolate, Local< FunctionTemplate > receiver=Local< FunctionTemplate >())
void SetAccessorProperty(Local< Name > name, Local< FunctionTemplate > getter=Local< FunctionTemplate >(), Local< FunctionTemplate > setter=Local< FunctionTemplate >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT)
void SetPrivate(Local< Private > name, Local< Data > value, PropertyAttribute attributes=None)
void Set(Local< Name > name, Local< Data > value, PropertyAttribute attributes=None)
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) AccessorNameGetterCallback
void(*)(Local< Name > property, const PropertyCallbackInfo< Boolean > &info) GenericNamedPropertyDeleterCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Boolean > &info) IndexedPropertyDeleterCallback
void(*)(Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info) AccessorSetterCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyDescriptorCallback
bool(*)(Local< Context > accessing_context, Local< Object > accessed_object, Local< Value > data) AccessCheckCallback
void(*)(uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info) IndexedPropertySetterCallback
void(*)(const FunctionCallbackInfo< Value > &info) FunctionCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Value > &info) IndexedPropertyGetterCallback
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyDescriptorCallback
void(*)(const PropertyCallbackInfo< Array > &info) GenericNamedPropertyEnumeratorCallback
void(*)(Local< Name > property, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyGetterCallback
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) AccessorNameSetterCallback
void(*)(Local< Name > property, const PropertyCallbackInfo< Integer > &info) GenericNamedPropertyQueryCallback
void(*)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< Value > &info) GenericNamedPropertySetterCallback
void(*)(uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) IndexedPropertyDefinerCallback
void(*)(const PropertyCallbackInfo< Array > &info) IndexedPropertyEnumeratorCallback
void(*)(Local< String > property, const PropertyCallbackInfo< Value > &info) AccessorGetterCallback
void(*)(Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) GenericNamedPropertyDefinerCallback
void(*)(uint32_t index, const PropertyCallbackInfo< Integer > &info) IndexedPropertyQueryCallback
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallback getter=nullptr, IndexedPropertySetterCallback setter=nullptr, IndexedPropertyQueryCallback query=nullptr, IndexedPropertyDeleterCallback deleter=nullptr, IndexedPropertyEnumeratorCallback enumerator=nullptr, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
IndexedPropertyQueryCallback query
IndexedPropertyDefinerCallback definer
IndexedPropertyDeleterCallback deleter
IndexedPropertyDescriptorCallback descriptor
IndexedPropertyGetterCallback getter
PropertyHandlerFlags flags
IndexedPropertySetterCallback setter
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallback getter, IndexedPropertySetterCallback setter, IndexedPropertyDescriptorCallback descriptor, IndexedPropertyDeleterCallback deleter, IndexedPropertyEnumeratorCallback enumerator, IndexedPropertyDefinerCallback definer, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
IndexedPropertyHandlerConfiguration(IndexedPropertyGetterCallback getter, IndexedPropertySetterCallback setter, IndexedPropertyQueryCallback query, IndexedPropertyDeleterCallback deleter, IndexedPropertyEnumeratorCallback enumerator, IndexedPropertyDefinerCallback definer, IndexedPropertyDescriptorCallback descriptor, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
IndexedPropertyEnumeratorCallback enumerator
NamedPropertyHandlerConfiguration(GenericNamedPropertyGetterCallback getter, GenericNamedPropertySetterCallback setter, GenericNamedPropertyDescriptorCallback descriptor, GenericNamedPropertyDeleterCallback deleter, GenericNamedPropertyEnumeratorCallback enumerator, GenericNamedPropertyDefinerCallback definer, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
GenericNamedPropertyQueryCallback query
GenericNamedPropertySetterCallback setter
GenericNamedPropertyGetterCallback getter
GenericNamedPropertyEnumeratorCallback enumerator
PropertyHandlerFlags flags
NamedPropertyHandlerConfiguration(GenericNamedPropertyGetterCallback getter, GenericNamedPropertySetterCallback setter, GenericNamedPropertyQueryCallback query, GenericNamedPropertyDeleterCallback deleter, GenericNamedPropertyEnumeratorCallback enumerator, GenericNamedPropertyDefinerCallback definer, GenericNamedPropertyDescriptorCallback descriptor, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
GenericNamedPropertyDefinerCallback definer
GenericNamedPropertyDescriptorCallback descriptor
GenericNamedPropertyDeleterCallback deleter
NamedPropertyHandlerConfiguration(GenericNamedPropertyGetterCallback getter=nullptr, GenericNamedPropertySetterCallback setter=nullptr, GenericNamedPropertyQueryCallback query=nullptr, GenericNamedPropertyDeleterCallback deleter=nullptr, GenericNamedPropertyEnumeratorCallback enumerator=nullptr, Local< Value > data=Local< Value >(), PropertyHandlerFlags flags=PropertyHandlerFlags::kNone)
#define V8_INTRINSICS_LIST(F)
#define V8_DECL_INTRINSIC(name, iname)
#define V8_DEPRECATED(message)
#define V8_WARN_UNUSED_RESULT