| 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 { |
| 11 {% if attribute.is_reflect and not attribute.is_url and | 11 {% if attribute.is_reflect and not attribute.is_url |
| 12 attribute.idl_type == 'DOMString' and is_node %} | 12 and attribute.idl_type == 'DOMString' and is_node |
| 13 and not attribute.is_implemented_in_private_script %} |
| 13 {% set cpp_class, v8_class = 'Element', 'V8Element' %} | 14 {% set cpp_class, v8_class = 'Element', 'V8Element' %} |
| 14 {% endif %} | 15 {% endif %} |
| 15 {# holder #} | 16 {# holder #} |
| 16 {% if not attribute.is_static %} | 17 {% if not attribute.is_static %} |
| 17 v8::Handle<v8::Object> holder = info.Holder(); | 18 v8::Handle<v8::Object> holder = info.Holder(); |
| 18 {% endif %} | 19 {% endif %} |
| 19 {# impl #} | 20 {# impl #} |
| 20 {% if attribute.cached_attribute_validation_method %} | 21 {% if attribute.cached_attribute_validation_method %} |
| 21 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "{{a
ttribute.name}}"); | 22 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "{{a
ttribute.name}}"); |
| 22 {{cpp_class}}* impl = {{v8_class}}::toNative(holder); | 23 {{cpp_class}}* impl = {{v8_class}}::toNative(holder); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 {##############################################################################} | 195 {##############################################################################} |
| 195 {% macro attribute_setter(attribute, world_suffix) %} | 196 {% macro attribute_setter(attribute, world_suffix) %} |
| 196 {% filter conditional(attribute.conditional_string) %} | 197 {% filter conditional(attribute.conditional_string) %} |
| 197 static void {{attribute.name}}AttributeSetter{{world_suffix}}( | 198 static void {{attribute.name}}AttributeSetter{{world_suffix}}( |
| 198 {%- if attribute.is_expose_js_accessors %} | 199 {%- if attribute.is_expose_js_accessors %} |
| 199 v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info | 200 v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info |
| 200 {%- else %} | 201 {%- else %} |
| 201 v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info | 202 v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info |
| 202 {%- endif %}) | 203 {%- endif %}) |
| 203 { | 204 { |
| 204 {% if attribute.is_reflect and attribute.idl_type == 'DOMString' and | 205 {% if attribute.is_reflect and attribute.idl_type == 'DOMString' |
| 205 is_node %} | 206 and is_node and not attribute.is_implemented_in_private_script %} |
| 206 {% set cpp_class, v8_class = 'Element', 'V8Element' %} | 207 {% set cpp_class, v8_class = 'Element', 'V8Element' %} |
| 207 {% endif %} | 208 {% endif %} |
| 208 {# Local variables #} | 209 {# Local variables #} |
| 209 {% if not attribute.is_static %} | 210 {% if not attribute.is_static %} |
| 210 v8::Handle<v8::Object> holder = info.Holder(); | 211 v8::Handle<v8::Object> holder = info.Holder(); |
| 211 {% endif %} | 212 {% endif %} |
| 212 {% if attribute.has_setter_exception_state %} | 213 {% if attribute.has_setter_exception_state %} |
| 213 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.na
me}}", "{{interface_name}}", holder, info.GetIsolate()); | 214 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.na
me}}", "{{interface_name}}", holder, info.GetIsolate()); |
| 214 {% endif %} | 215 {% endif %} |
| 215 {# Type checking #} | 216 {# Type checking #} |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 if (block.HasCaught()) { | 396 if (block.HasCaught()) { |
| 396 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 397 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
| 397 // FIXME: We should support exceptions other than DOM exceptions. | 398 // FIXME: We should support exceptions other than DOM exceptions. |
| 398 RELEASE_ASSERT_NOT_REACHED(); | 399 RELEASE_ASSERT_NOT_REACHED(); |
| 399 } | 400 } |
| 400 return false; | 401 return false; |
| 401 } | 402 } |
| 402 return true; | 403 return true; |
| 403 } | 404 } |
| 404 {% endmacro %} | 405 {% endmacro %} |
| OLD | NEW |