OLD | NEW |
1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
2 # coding=utf-8 | 2 # coding=utf-8 |
3 # | 3 # |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 # Constructors | 748 # Constructors |
749 ################################################################################ | 749 ################################################################################ |
750 | 750 |
751 # [Constructor] | 751 # [Constructor] |
752 def generate_constructor(interface, constructor): | 752 def generate_constructor(interface, constructor): |
753 arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(argument) | 753 arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(argument) |
754 for argument in constructor.arguments) | 754 for argument in constructor.arguments) |
755 | 755 |
756 return { | 756 return { |
757 'argument_list': constructor_argument_list(interface, constructor), | 757 'argument_list': constructor_argument_list(interface, constructor), |
758 'arguments': [v8_methods.generate_argument(interface, constructor, argum
ent, index, arguments_need_try_catch) | 758 'arguments': [v8_methods.generate_argument(interface, constructor, argum
ent, index) |
759 for index, argument in enumerate(constructor.arguments)], | 759 for index, argument in enumerate(constructor.arguments)], |
760 'arguments_need_try_catch': arguments_need_try_catch, | 760 'arguments_need_try_catch': arguments_need_try_catch, |
761 'cpp_type': cpp_template_type( | 761 'cpp_type': cpp_template_type( |
762 cpp_ptr_type('RefPtr', 'RawPtr', gc_type(interface)), | 762 cpp_ptr_type('RefPtr', 'RawPtr', gc_type(interface)), |
763 cpp_name(interface)), | 763 cpp_name(interface)), |
764 'has_exception_state': | 764 'has_exception_state': |
765 # [RaisesException=Constructor] | 765 # [RaisesException=Constructor] |
766 interface.extended_attributes.get('RaisesException') == 'Constructor
' or | 766 interface.extended_attributes.get('RaisesException') == 'Constructor
' or |
767 any(argument for argument in constructor.arguments | 767 any(argument for argument in constructor.arguments |
768 if argument.idl_type.name == 'SerializedScriptValue' or | 768 if argument.idl_type.name == 'SerializedScriptValue' or |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 deleter = next( | 1007 deleter = next( |
1008 method | 1008 method |
1009 for method in interface.operations | 1009 for method in interface.operations |
1010 if ('deleter' in method.specials and | 1010 if ('deleter' in method.specials and |
1011 len(method.arguments) == 1 and | 1011 len(method.arguments) == 1 and |
1012 str(method.arguments[0].idl_type) == 'DOMString')) | 1012 str(method.arguments[0].idl_type) == 'DOMString')) |
1013 except StopIteration: | 1013 except StopIteration: |
1014 return None | 1014 return None |
1015 | 1015 |
1016 return property_deleter(deleter) | 1016 return property_deleter(deleter) |
OLD | NEW |