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