| 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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 l.sort(key=key) | 843 l.sort(key=key) |
| 844 return ((k, list(g)) for k, g in itertools.groupby(l, key)) | 844 return ((k, list(g)) for k, g in itertools.groupby(l, key)) |
| 845 | 845 |
| 846 | 846 |
| 847 ################################################################################ | 847 ################################################################################ |
| 848 # Constructors | 848 # Constructors |
| 849 ################################################################################ | 849 ################################################################################ |
| 850 | 850 |
| 851 # [Constructor] | 851 # [Constructor] |
| 852 def constructor_context(interface, constructor): | 852 def constructor_context(interface, constructor): |
| 853 arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(argument) | 853 arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(argument,
async=False) |
| 854 for argument in constructor.arguments) | 854 for argument in constructor.arguments) |
| 855 | 855 |
| 856 # [RaisesException=Constructor] | 856 # [RaisesException=Constructor] |
| 857 is_constructor_raises_exception = \ | 857 is_constructor_raises_exception = \ |
| 858 interface.extended_attributes.get('RaisesException') == 'Constructor' | 858 interface.extended_attributes.get('RaisesException') == 'Constructor' |
| 859 | 859 |
| 860 return { | 860 return { |
| 861 'arguments': [v8_methods.argument_context(interface, constructor, argume
nt, index) | 861 'arguments': [v8_methods.argument_context(interface, constructor, argume
nt, index) |
| 862 for index, argument in enumerate(constructor.arguments)], | 862 for index, argument in enumerate(constructor.arguments)], |
| 863 'arguments_need_try_catch': arguments_need_try_catch, | 863 'arguments_need_try_catch': arguments_need_try_catch, |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 deleter = next( | 1102 deleter = next( |
| 1103 method | 1103 method |
| 1104 for method in interface.operations | 1104 for method in interface.operations |
| 1105 if ('deleter' in method.specials and | 1105 if ('deleter' in method.specials and |
| 1106 len(method.arguments) == 1 and | 1106 len(method.arguments) == 1 and |
| 1107 str(method.arguments[0].idl_type) == 'DOMString')) | 1107 str(method.arguments[0].idl_type) == 'DOMString')) |
| 1108 except StopIteration: | 1108 except StopIteration: |
| 1109 return None | 1109 return None |
| 1110 | 1110 |
| 1111 return property_deleter(deleter) | 1111 return property_deleter(deleter) |
| OLD | NEW |