| OLD | NEW |
| 1 {% extends 'interface_base.cpp' %} | 1 {% extends 'interface_base.cpp' %} |
| 2 | 2 |
| 3 | 3 |
| 4 {##############################################################################} | 4 {##############################################################################} |
| 5 {% block indexed_property_getter %} | 5 {% block indexed_property_getter %} |
| 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} | 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} |
| 7 {% set getter = indexed_property_getter %} | 7 {% set getter = indexed_property_getter %} |
| 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 9 { | 9 { |
| 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); | 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); |
| (...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 namedPropertiesObjectTemplate->SetInternalFieldCount({{v8_class}}::internalF
ieldCount); | 717 namedPropertiesObjectTemplate->SetInternalFieldCount({{v8_class}}::internalF
ieldCount); |
| 718 V8DOMConfiguration::setClassString(isolate, namedPropertiesObjectTemplate, "
{{interface_name}}Properties"); | 718 V8DOMConfiguration::setClassString(isolate, namedPropertiesObjectTemplate, "
{{interface_name}}Properties"); |
| 719 {{install_named_property_handler('namedPropertiesObjectTemplate') | indent}} | 719 {{install_named_property_handler('namedPropertiesObjectTemplate') | indent}} |
| 720 | 720 |
| 721 return namedPropertiesObjectFunctionTemplate; | 721 return namedPropertiesObjectFunctionTemplate; |
| 722 } | 722 } |
| 723 | 723 |
| 724 {% endif %} | 724 {% endif %} |
| 725 {% endblock %} | 725 {% endblock %} |
| 726 | 726 |
| 727 | |
| 728 {##############################################################################} | 727 {##############################################################################} |
| 729 {% block has_instance %} | 728 {% block has_instance %} |
| 729 {% if not is_array_buffer_or_view %} |
| 730 |
| 730 bool {{v8_class}}::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolat
e) | 731 bool {{v8_class}}::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolat
e) |
| 731 { | 732 { |
| 732 {% if is_array_buffer_or_view %} | |
| 733 return v8Value->Is{{interface_name}}(); | |
| 734 {% else %} | |
| 735 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | 733 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); |
| 736 {% endif %} | |
| 737 } | 734 } |
| 738 | 735 |
| 739 {% if not is_array_buffer_or_view %} | |
| 740 v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V
alue> v8Value, v8::Isolate* isolate) | 736 v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V
alue> v8Value, v8::Isolate* isolate) |
| 741 { | 737 { |
| 742 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 738 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 743 } | 739 } |
| 744 | 740 |
| 745 {% endif %} | 741 {% endif %} |
| 746 {% endblock %} | 742 {% endblock %} |
| 747 | 743 |
| 748 | 744 |
| 749 {##############################################################################} | 745 {##############################################################################} |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 } | 825 } |
| 830 | 826 |
| 831 {% endif %} | 827 {% endif %} |
| 832 {% endblock %} | 828 {% endblock %} |
| 833 | 829 |
| 834 | 830 |
| 835 {##############################################################################} | 831 {##############################################################################} |
| 836 {% block to_impl_with_type_check %} | 832 {% block to_impl_with_type_check %} |
| 837 {{cpp_class}}* {{v8_class}}::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local
<v8::Value> value) | 833 {{cpp_class}}* {{v8_class}}::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local
<v8::Value> value) |
| 838 { | 834 { |
| 839 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : 0; | 835 {% if is_array_buffer_or_view %} |
| 836 return value->Is{{interface_name}}() ? toImpl(v8::Local<v8::Object>::Cast(va
lue)) : nullptr; |
| 837 {% else %} |
| 838 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
| 839 {% endif %} |
| 840 } | 840 } |
| 841 | 841 |
| 842 {% endblock %} | 842 {% endblock %} |
| 843 | 843 |
| 844 | 844 |
| 845 {##############################################################################} | 845 {##############################################################################} |
| 846 {% block install_conditional_attributes %} | 846 {% block install_conditional_attributes %} |
| 847 {% from 'attributes.cpp' import attribute_configuration with context %} | 847 {% from 'attributes.cpp' import attribute_configuration with context %} |
| 848 {% if has_conditional_attributes_on_instance %} | 848 {% if has_conditional_attributes_on_instance %} |
| 849 void {{v8_class}}::installConditionallyEnabledProperties(v8::Local<v8::Object> i
nstanceObject, v8::Isolate* isolate) | 849 void {{v8_class}}::installConditionallyEnabledProperties(v8::Local<v8::Object> i
nstanceObject, v8::Isolate* isolate) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 | 934 |
| 935 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} | 935 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} |
| 936 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 936 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
| 937 { | 937 { |
| 938 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 938 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
| 939 } | 939 } |
| 940 | 940 |
| 941 {% endfor %} | 941 {% endfor %} |
| 942 {% endif %} | 942 {% endif %} |
| 943 {% endblock %} | 943 {% endblock %} |
| OLD | NEW |