OLD | NEW |
1 {##############################################################################} | 1 {##############################################################################} |
2 {% macro attribute_getter(attribute, world_suffix) %} | 2 {% macro attribute_getter(attribute, world_suffix) %} |
3 {% filter conditional(attribute.conditional_string) %} | 3 {% filter conditional(attribute.conditional_string) %} |
4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( | 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( |
5 {%- if attribute.is_expose_js_accessors %} | 5 {%- if attribute.is_expose_js_accessors %} |
6 const v8::FunctionCallbackInfo<v8::Value>& info | 6 const v8::FunctionCallbackInfo<v8::Value>& info |
7 {%- else %} | 7 {%- else %} |
8 const v8::PropertyCallbackInfo<v8::Value>& info | 8 const v8::PropertyCallbackInfo<v8::Value>& info |
9 {%- endif %}) | 9 {%- endif %}) |
10 { | 10 { |
(...skipping 27 matching lines...) Expand all Loading... |
38 {% if attribute.is_call_with_execution_context %} | 38 {% if attribute.is_call_with_execution_context %} |
39 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 39 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
40 {% endif %} | 40 {% endif %} |
41 {% if attribute.is_call_with_script_state %} | 41 {% if attribute.is_call_with_script_state %} |
42 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); | 42 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
43 {% endif %} | 43 {% endif %} |
44 {% if attribute.is_check_security_for_node or | 44 {% if attribute.is_check_security_for_node or |
45 attribute.is_getter_raises_exception %} | 45 attribute.is_getter_raises_exception %} |
46 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{interface_name}}", holder, info.GetIsolate()); | 46 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{interface_name}}", holder, info.GetIsolate()); |
47 {% endif %} | 47 {% endif %} |
48 {% if attribute.is_nullable and not attribute.has_type_checking_nullable %} | 48 {% if attribute.is_nullable and not attribute.is_nullable_simple %} |
49 bool isNull = false; | 49 bool isNull = false; |
50 {% endif %} | 50 {% endif %} |
51 {% if attribute.cpp_value_original %} | 51 {% if attribute.cpp_value_original %} |
52 {{attribute.cpp_type}} {{attribute.cpp_value}}({{attribute.cpp_value_origina
l}}); | 52 {{attribute.cpp_type}} {{attribute.cpp_value}}({{attribute.cpp_value_origina
l}}); |
53 {% endif %} | 53 {% endif %} |
54 {# Checks #} | 54 {# Checks #} |
55 {% if attribute.is_getter_raises_exception %} | 55 {% if attribute.is_getter_raises_exception %} |
56 if (UNLIKELY(exceptionState.throwIfNeeded())) | 56 if (UNLIKELY(exceptionState.throwIfNeeded())) |
57 return; | 57 return; |
58 {% endif %} | 58 {% endif %} |
59 {% if attribute.is_check_security_for_node %} | 59 {% if attribute.is_check_security_for_node %} |
60 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), {{attribute
.cpp_value}}, exceptionState)) { | 60 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), {{attribute
.cpp_value}}, exceptionState)) { |
61 v8SetReturnValueNull(info); | 61 v8SetReturnValueNull(info); |
62 exceptionState.throwIfNeeded(); | 62 exceptionState.throwIfNeeded(); |
63 return; | 63 return; |
64 } | 64 } |
65 {% endif %} | 65 {% endif %} |
66 {% if attribute.reflect_only %} | 66 {% if attribute.reflect_only %} |
67 {{release_only_check(attribute.reflect_only, attribute.reflect_missing, | 67 {{release_only_check(attribute.reflect_only, attribute.reflect_missing, |
68 attribute.reflect_invalid, attribute.reflect_empty, | 68 attribute.reflect_invalid, attribute.reflect_empty, |
69 attribute.cpp_value) | 69 attribute.cpp_value) |
70 | indent}} | 70 | indent}} |
71 {% endif %} | 71 {% endif %} |
72 {% if attribute.is_nullable %} | 72 {% if attribute.is_nullable %} |
73 {% if attribute.has_type_checking_nullable %} | 73 {% if attribute.is_nullable_simple %} |
74 if (!{{attribute.cpp_value}}) { | 74 if (!{{attribute.cpp_value}}) { |
75 {% else %} | 75 {% else %} |
76 if (isNull) { | 76 if (isNull) { |
77 {% endif %} | 77 {% endif %} |
78 v8SetReturnValueNull(info); | 78 v8SetReturnValueNull(info); |
79 return; | 79 return; |
80 } | 80 } |
81 {% endif %} | 81 {% endif %} |
82 {% if attribute.cached_attribute_validation_method %} | 82 {% if attribute.cached_attribute_validation_method %} |
83 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, {{att
ribute.cpp_value_to_v8_value}}); | 83 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, {{att
ribute.cpp_value_to_v8_value}}); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 {% endif %} | 331 {% endif %} |
332 {% if attribute.has_custom_setter %} | 332 {% if attribute.has_custom_setter %} |
333 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); | 333 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); |
334 {% else %} | 334 {% else %} |
335 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v
8Value, info); | 335 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v
8Value, info); |
336 {% endif %} | 336 {% endif %} |
337 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 337 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
338 } | 338 } |
339 {% endfilter %} | 339 {% endfilter %} |
340 {% endmacro %} | 340 {% endmacro %} |
OLD | NEW |