| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 Until then, please work on the Perl IDL compiler. | 34 Until then, please work on the Perl IDL compiler. |
| 35 For details, see bug http://crbug.com/239771 | 35 For details, see bug http://crbug.com/239771 |
| 36 """ | 36 """ |
| 37 | 37 |
| 38 import v8_attributes | 38 import v8_attributes |
| 39 from v8_globals import includes | 39 from v8_globals import includes |
| 40 import v8_methods | 40 import v8_methods |
| 41 import v8_types | 41 import v8_types |
| 42 from v8_types import inherits_interface | 42 from v8_types import inherits_interface |
| 43 import v8_utilities | 43 import v8_utilities |
| 44 from v8_utilities import capitalize, conditional_string, cpp_name, has_extended_
attribute, has_extended_attribute_value, runtime_enabled_function_name | 44 from v8_utilities import capitalize, conditional_string, cpp_name, has_extended_
attribute_value, runtime_enabled_function_name |
| 45 | 45 |
| 46 | 46 |
| 47 INTERFACE_H_INCLUDES = set([ | 47 INTERFACE_H_INCLUDES = set([ |
| 48 'bindings/v8/V8Binding.h', | 48 'bindings/v8/V8Binding.h', |
| 49 'bindings/v8/V8DOMWrapper.h', | 49 'bindings/v8/V8DOMWrapper.h', |
| 50 'bindings/v8/WrapperTypeInfo.h', | 50 'bindings/v8/WrapperTypeInfo.h', |
| 51 ]) | 51 ]) |
| 52 INTERFACE_CPP_INCLUDES = set([ | 52 INTERFACE_CPP_INCLUDES = set([ |
| 53 'RuntimeEnabledFeatures.h', | 53 'RuntimeEnabledFeatures.h', |
| 54 'bindings/v8/ExceptionState.h', | 54 'bindings/v8/ExceptionState.h', |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 def property_getter(getter): | 489 def property_getter(getter): |
| 490 def is_null_expression(idl_type): | 490 def is_null_expression(idl_type): |
| 491 if idl_type == 'DOMString': | 491 if idl_type == 'DOMString': |
| 492 return 'element.isNull()' | 492 return 'element.isNull()' |
| 493 return None | 493 return None |
| 494 | 494 |
| 495 idl_type = getter.idl_type | 495 idl_type = getter.idl_type |
| 496 extended_attributes = getter.extended_attributes | 496 extended_attributes = getter.extended_attributes |
| 497 return { | 497 return { |
| 498 'cpp_type': v8_types.cpp_type(idl_type), | 498 'cpp_type': v8_types.cpp_type(idl_type), |
| 499 'is_custom': 'Custom' in extended_attributes, | 499 'is_custom': |
| 500 'Custom' in extended_attributes and |
| 501 (not extended_attributes['Custom'] or |
| 502 has_extended_attribute_value(getter, 'Custom', 'PropertyGetter')), |
| 503 'is_custom_property_enumerator': has_extended_attribute_value( |
| 504 getter, 'Custom', 'PropertyEnumerator'), |
| 505 'is_custom_property_query': has_extended_attribute_value( |
| 506 getter, 'Custom', 'PropertyQuery'), |
| 500 'is_null_expression': is_null_expression(idl_type), | 507 'is_null_expression': is_null_expression(idl_type), |
| 501 'name': cpp_name(getter), | 508 'name': cpp_name(getter), |
| 502 'v8_set_return_value': v8_types.v8_set_return_value(idl_type, 'element',
extended_attributes=extended_attributes, script_wrappable='collection'), | 509 'v8_set_return_value': v8_types.v8_set_return_value(idl_type, 'element',
extended_attributes=extended_attributes, script_wrappable='collection'), |
| 503 } | 510 } |
| 504 | 511 |
| 505 | 512 |
| 506 def property_setter(setter): | 513 def property_setter(setter): |
| 507 idl_type = setter.arguments[1].idl_type | 514 idl_type = setter.arguments[1].idl_type |
| 508 extended_attributes = setter.extended_attributes | 515 extended_attributes = setter.extended_attributes |
| 509 return { | 516 return { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 deleter = next( | 631 deleter = next( |
| 625 method | 632 method |
| 626 for method in interface.operations | 633 for method in interface.operations |
| 627 if ('deleter' in method.specials and | 634 if ('deleter' in method.specials and |
| 628 len(method.arguments) == 1 and | 635 len(method.arguments) == 1 and |
| 629 method.arguments[0].idl_type == 'DOMString')) | 636 method.arguments[0].idl_type == 'DOMString')) |
| 630 except StopIteration: | 637 except StopIteration: |
| 631 return None | 638 return None |
| 632 | 639 |
| 633 return property_deleter(deleter) | 640 return property_deleter(deleter) |
| OLD | NEW |