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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 'has_strict_type_checking': | 600 'has_strict_type_checking': |
601 'StrictTypeChecking' in extended_attributes and | 601 'StrictTypeChecking' in extended_attributes and |
602 idl_type.is_wrapper_type, | 602 idl_type.is_wrapper_type, |
603 'idl_type': idl_type.base_type, | 603 'idl_type': idl_type.base_type, |
604 'is_custom': 'Custom' in extended_attributes, | 604 'is_custom': 'Custom' in extended_attributes, |
605 'has_exception_state': is_raises_exception or | 605 'has_exception_state': is_raises_exception or |
606 idl_type.is_integer_type, | 606 idl_type.is_integer_type, |
607 'is_raises_exception': is_raises_exception, | 607 'is_raises_exception': is_raises_exception, |
608 'name': cpp_name(setter), | 608 'name': cpp_name(setter), |
609 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value( | 609 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value( |
610 extended_attributes, 'jsValue', 'propertyValue'), | 610 extended_attributes, 'v8Value', 'propertyValue'), |
611 } | 611 } |
612 | 612 |
613 | 613 |
614 def property_deleter(deleter): | 614 def property_deleter(deleter): |
615 idl_type = deleter.idl_type | 615 idl_type = deleter.idl_type |
616 if str(idl_type) != 'boolean': | 616 if str(idl_type) != 'boolean': |
617 raise Exception( | 617 raise Exception( |
618 'Only deleters with boolean type are allowed, but type is "%s"' % | 618 'Only deleters with boolean type are allowed, but type is "%s"' % |
619 idl_type) | 619 idl_type) |
620 extended_attributes = deleter.extended_attributes | 620 extended_attributes = deleter.extended_attributes |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 deleter = next( | 723 deleter = next( |
724 method | 724 method |
725 for method in interface.operations | 725 for method in interface.operations |
726 if ('deleter' in method.specials and | 726 if ('deleter' in method.specials and |
727 len(method.arguments) == 1 and | 727 len(method.arguments) == 1 and |
728 str(method.arguments[0].idl_type) == 'DOMString')) | 728 str(method.arguments[0].idl_type) == 'DOMString')) |
729 except StopIteration: | 729 except StopIteration: |
730 return None | 730 return None |
731 | 731 |
732 return property_deleter(deleter) | 732 return property_deleter(deleter) |
OLD | NEW |