Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {% from 'conversions.cpp' import v8_value_to_local_cpp_value %} | 1 {% from 'conversions.cpp' import v8_value_to_local_cpp_value %} |
| 2 | 2 |
| 3 | 3 |
| 4 {##############################################################################} | 4 {##############################################################################} |
| 5 {% macro attribute_getter(attribute, world_suffix) %} | 5 {% macro attribute_getter(attribute, world_suffix) %} |
| 6 {% filter conditional(attribute.conditional_string) %} | 6 {% filter conditional(attribute.conditional_string) %} |
| 7 static void {{attribute.name}}AttributeGetter{{world_suffix}}( | 7 static void {{attribute.name}}AttributeGetter{{world_suffix}}( |
| 8 {%- if attribute.is_expose_js_accessors %} | 8 {%- if attribute.is_expose_js_accessors %} |
| 9 const v8::FunctionCallbackInfo<v8::Value>& info | 9 const v8::FunctionCallbackInfo<v8::Value>& info |
| 10 {%- else %} | 10 {%- else %} |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 (cpp_class_or_partial, attribute.name) | 412 (cpp_class_or_partial, attribute.name) |
| 413 if attribute.needs_constructor_getter_callback else ( | 413 if attribute.needs_constructor_getter_callback else ( |
| 414 'v8ConstructorAttributeGetterAsAccessor' | 414 'v8ConstructorAttributeGetterAsAccessor' |
| 415 if attribute.is_expose_js_accessors else ( | 415 if attribute.is_expose_js_accessors else ( |
| 416 'v8ConstructorAttributeGetterAsProperty'))) %} | 416 'v8ConstructorAttributeGetterAsProperty'))) %} |
| 417 {% set getter_callback_for_main_world = | 417 {% set getter_callback_for_main_world = |
| 418 '%sV8Internal::%sAttributeGetterCallbackForMainWorld' % | 418 '%sV8Internal::%sAttributeGetterCallbackForMainWorld' % |
| 419 (cpp_class_or_partial, attribute.name) | 419 (cpp_class_or_partial, attribute.name) |
| 420 if attribute.is_per_world_bindings else '0' %} | 420 if attribute.is_per_world_bindings else '0' %} |
| 421 {% set setter_callback = | 421 {% set setter_callback = |
| 422 '0' if not attribute.has_setter else ( | |
| 423 '%sV8Internal::%sConstructorAttributeSetterCallbackAsProperty' % | |
| 424 (cpp_class_or_partial, cpp_class) | |
| 425 if (attribute.constructor_type and | |
| 426 attribute.name == attribute.constructor_type and | |
| 427 not attribute.is_expose_js_accessors) else ( | |
| 428 '%sV8Internal::%sConstructorAttributeSetterCallbackAsAccessor' % | |
| 429 (cpp_class_or_partial, cpp_class) | |
| 430 if (attribute.constructor_type and | |
| 431 attribute.name == attribute.constructor_type and | |
| 432 attribute.is_expose_js_accessors) else ( | |
|
haraken
2015/03/17 00:06:07
Can we clean up these branches somehow? It looks t
Yuki
2015/03/17 08:35:19
Tried my best.
| |
| 422 '%sV8Internal::%sAttributeSetterCallback' % | 433 '%sV8Internal::%sAttributeSetterCallback' % |
| 423 (cpp_class_or_partial, attribute.name) | 434 (cpp_class_or_partial, attribute.name)))) %} |
| 424 if attribute.has_setter else '0' %} | |
| 425 {% set setter_callback_for_main_world = | 435 {% set setter_callback_for_main_world = |
| 426 '%sV8Internal::%sAttributeSetterCallbackForMainWorld' % | 436 '%sV8Internal::%sAttributeSetterCallbackForMainWorld' % |
| 427 (cpp_class_or_partial, attribute.name) | 437 (cpp_class_or_partial, attribute.name) |
| 428 if attribute.is_per_world_bindings and attribute.has_setter else '0' %} | 438 if attribute.is_per_world_bindings and attribute.has_setter else '0' %} |
| 429 {% set wrapper_type_info = | 439 {% set wrapper_type_info = |
| 430 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % | 440 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % |
| 431 attribute.constructor_type | 441 attribute.constructor_type |
| 432 if attribute.constructor_type else '0' %} | 442 if attribute.constructor_type else '0' %} |
| 433 {% set access_control = 'static_cast<v8::AccessControl>(%s)' % | 443 {% set access_control = 'static_cast<v8::AccessControl>(%s)' % |
| 434 ' | '.join(attribute.access_control_list) %} | 444 ' | '.join(attribute.access_control_list) %} |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 448 access_control, | 458 access_control, |
| 449 property_attribute, | 459 property_attribute, |
| 450 only_exposed_to_private_script, | 460 only_exposed_to_private_script, |
| 451 ] %} | 461 ] %} |
| 452 {% if not attribute.is_expose_js_accessors %} | 462 {% if not attribute.is_expose_js_accessors %} |
| 453 {% set attribute_configuration_list = attribute_configuration_list | 463 {% set attribute_configuration_list = attribute_configuration_list |
| 454 + [on_prototype] %} | 464 + [on_prototype] %} |
| 455 {% endif %} | 465 {% endif %} |
| 456 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} | 466 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} |
| 457 {%- endmacro %} | 467 {%- endmacro %} |
| OLD | NEW |