OLD | NEW |
1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t
o_local_cpp_value %} | 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t
o_local_cpp_value %} |
2 | 2 |
3 {##############################################################################} | 3 {##############################################################################} |
4 {% macro attribute_getter(attribute, world_suffix) %} | 4 {% macro attribute_getter(attribute, world_suffix) %} |
5 static void {{attribute.name}}AttributeGetter{{world_suffix}}( | 5 static void {{attribute.name}}AttributeGetter{{world_suffix}}( |
6 {%- if attribute.is_data_type_property %} | 6 {%- if attribute.is_data_type_property %} |
7 const v8::PropertyCallbackInfo<v8::Value>& info | 7 const v8::PropertyCallbackInfo<v8::Value>& info |
8 {%- else %} | 8 {%- else %} |
9 const v8::FunctionCallbackInfo<v8::Value>& info | 9 const v8::FunctionCallbackInfo<v8::Value>& info |
10 {%- endif %}) { | 10 {%- endif %}) { |
11 {% filter format_remove_duplicates(['ExceptionState exceptionState']) %} | 11 {% filter format_remove_duplicates(['ExceptionState exceptionState']) %} |
12 {% set define_exception_state -%} | 12 {% set define_exception_state -%} |
13 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kGetterContex
t, "{{interface_name}}", "{{attribute.name}}"); | 13 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kGetterContex
t, "{{interface_name}}", "{{attribute.name}}"); |
14 {%- endset %} | 14 {%- endset %} |
15 | 15 |
16 {% if attribute.is_lenient_this %} | 16 {% if attribute.is_lenient_this %} |
17 // [LenientThis] | 17 // [LenientThis] |
18 // Make sure that info.Holder() really points to an instance if [LenientThis]. | 18 // Make sure that info.Holder() really points to an instance if [LenientThis]. |
19 if (!{{v8_class}}::hasInstance(info.Holder(), info.GetIsolate())) | 19 if (!{{v8_class}}::hasInstance(info.Holder(), info.GetIsolate())) |
20 return; // Return silently because of [LenientThis]. | 20 return; // Return silently because of [LenientThis]. |
21 {% endif %} | 21 {% endif %} |
22 | 22 |
23 {% if not attribute.is_static %} | 23 {% if not attribute.is_static or attribute.is_save_same_object %} |
24 v8::Local<v8::Object> holder = info.Holder(); | 24 v8::Local<v8::Object> holder = info.Holder(); |
25 {% endif %} | 25 {% endif %} |
26 | 26 |
27 {% if attribute.is_save_same_object %} | 27 {% if attribute.is_save_same_object %} |
28 // [SaveSameObject] | 28 // [SaveSameObject] |
29 {% set same_object_private_key = interface_name + attribute.name[0]|capitalize
+ attribute.name[1:] %} | 29 {% set same_object_private_key = interface_name + attribute.name[0]|capitalize
+ attribute.name[1:] %} |
30 // If you see a compile error that | 30 // If you see a compile error that |
31 // V8PrivateProperty::GetSameObject{{same_object_private_key}} | 31 // V8PrivateProperty::GetSameObject{{same_object_private_key}} |
32 // is not defined, then you need to register your attribute at | 32 // is not defined, then you need to register your attribute at |
33 // V8_PRIVATE_PROPERTY_FOR_EACH defined in V8PrivateProperty.h as | 33 // V8_PRIVATE_PROPERTY_FOR_EACH defined in V8PrivateProperty.h as |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration[] =
{ | 579 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration[] =
{ |
580 {{accessor_configuration(attribute)}} | 580 {{accessor_configuration(attribute)}} |
581 }; | 581 }; |
582 for (const auto& accessorConfig : accessorConfiguration) | 582 for (const auto& accessorConfig : accessorConfiguration) |
583 V8DOMConfiguration::InstallAccessor(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, accessorConfig); | 583 V8DOMConfiguration::InstallAccessor(isolate, world, v8::Local<v8::Object>(), p
rototypeObject, interfaceObject, signature, accessorConfig); |
584 {% endfilter %}{# runtime_enabled #} | 584 {% endfilter %}{# runtime_enabled #} |
585 {% endfilter %}{# secure_context #} | 585 {% endfilter %}{# secure_context #} |
586 {% endfilter %}{# exposed #} | 586 {% endfilter %}{# exposed #} |
587 {% endfor %} | 587 {% endfor %} |
588 {% endmacro %} | 588 {% endmacro %} |
OLD | NEW |