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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); | 43 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
44 {% endif %} | 44 {% endif %} |
45 {% if attribute.is_check_security_for_node or | 45 {% if attribute.is_check_security_for_node or |
46 attribute.is_getter_raises_exception %} | 46 attribute.is_getter_raises_exception %} |
47 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{interface_name}}", holder, info.GetIsolate()); | 47 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{interface_name}}", holder, info.GetIsolate()); |
48 {% endif %} | 48 {% endif %} |
49 {% if attribute.is_explicit_nullable %} | 49 {% if attribute.is_explicit_nullable %} |
50 bool isNull = false; | 50 bool isNull = false; |
51 {% endif %} | 51 {% endif %} |
52 {% if attribute.is_implemented_in_private_script %} | 52 {% if attribute.is_implemented_in_private_script %} |
53 {{attribute.cpp_type}} result; | 53 {{attribute.cpp_type}} result{% if attribute.cpp_type == 'int' %} = 0{% endi
f %}; |
54 if (!{{attribute.cpp_value_original}}) | 54 if (!{{attribute.cpp_value_original}}) |
55 return; | 55 return; |
56 {% elif attribute.cpp_value_original %} | 56 {% elif attribute.cpp_value_original %} |
57 {{attribute.cpp_type}} {{attribute.cpp_value}}({{attribute.cpp_value_origina
l}}); | 57 {{attribute.cpp_type}} {{attribute.cpp_value}}({{attribute.cpp_value_origina
l}}); |
58 {% endif %} | 58 {% endif %} |
59 {# Checks #} | 59 {# Checks #} |
60 {% if attribute.is_getter_raises_exception %} | 60 {% if attribute.is_getter_raises_exception %} |
61 if (UNLIKELY(exceptionState.throwIfNeeded())) | 61 if (UNLIKELY(exceptionState.throwIfNeeded())) |
62 return; | 62 return; |
63 {% endif %} | 63 {% endif %} |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 if (block.HasCaught()) { | 396 if (block.HasCaught()) { |
397 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 397 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
398 // FIXME: We should support exceptions other than DOM exceptions. | 398 // FIXME: We should support exceptions other than DOM exceptions. |
399 RELEASE_ASSERT_NOT_REACHED(); | 399 RELEASE_ASSERT_NOT_REACHED(); |
400 } | 400 } |
401 return false; | 401 return false; |
402 } | 402 } |
403 return true; | 403 return true; |
404 } | 404 } |
405 {% endmacro %} | 405 {% endmacro %} |
OLD | NEW |