Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: Source/bindings/scripts/v8_interface.py

Issue 232563003: API functions returning Promises should not throw exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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)
haraken 2014/08/01 17:04:24 async => return_promise ? The same comment for ot
yhirano 2014/08/04 01:42:08 Done.
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
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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698