| 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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 l.sort(key=key) | 849 l.sort(key=key) |
| 850 return ((k, list(g)) for k, g in itertools.groupby(l, key)) | 850 return ((k, list(g)) for k, g in itertools.groupby(l, key)) |
| 851 | 851 |
| 852 | 852 |
| 853 ################################################################################ | 853 ################################################################################ |
| 854 # Constructors | 854 # Constructors |
| 855 ################################################################################ | 855 ################################################################################ |
| 856 | 856 |
| 857 # [Constructor] | 857 # [Constructor] |
| 858 def constructor_context(interface, constructor): | 858 def constructor_context(interface, constructor): |
| 859 arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(argument,
return_promise=False) | 859 arguments_need_try_catch = any(v8_methods.argument_needs_try_catch(construct
or, argument) |
| 860 for argument in constructor.arguments) | 860 for argument in constructor.arguments) |
| 861 | 861 |
| 862 # [RaisesException=Constructor] | 862 # [RaisesException=Constructor] |
| 863 is_constructor_raises_exception = \ | 863 is_constructor_raises_exception = \ |
| 864 interface.extended_attributes.get('RaisesException') == 'Constructor' | 864 interface.extended_attributes.get('RaisesException') == 'Constructor' |
| 865 | 865 |
| 866 return { | 866 return { |
| 867 'arguments': [v8_methods.argument_context(interface, constructor, argume
nt, index) | 867 'arguments': [v8_methods.argument_context(interface, constructor, argume
nt, index) |
| 868 for index, argument in enumerate(constructor.arguments)], | 868 for index, argument in enumerate(constructor.arguments)], |
| 869 'arguments_need_try_catch': arguments_need_try_catch, | 869 'arguments_need_try_catch': arguments_need_try_catch, |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 deleter = next( | 1111 deleter = next( |
| 1112 method | 1112 method |
| 1113 for method in interface.operations | 1113 for method in interface.operations |
| 1114 if ('deleter' in method.specials and | 1114 if ('deleter' in method.specials and |
| 1115 len(method.arguments) == 1 and | 1115 len(method.arguments) == 1 and |
| 1116 str(method.arguments[0].idl_type) == 'DOMString')) | 1116 str(method.arguments[0].idl_type) == 'DOMString')) |
| 1117 except StopIteration: | 1117 except StopIteration: |
| 1118 return None | 1118 return None |
| 1119 | 1119 |
| 1120 return property_deleter(deleter) | 1120 return property_deleter(deleter) |
| OLD | NEW |