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

Unified Diff: Source/bindings/scripts/unstable/v8_attributes.py

Issue 131453010: IDL compiler: [RaisesException] on interface type attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Simpler Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObjectPython.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/unstable/v8_attributes.py
diff --git a/Source/bindings/scripts/unstable/v8_attributes.py b/Source/bindings/scripts/unstable/v8_attributes.py
index 59a9b4ace5e6b8e5626b043d947c4fe2f0871426..f70bf1a274c6a3a9c3f2f99a3b52175a93f1ec5e 100644
--- a/Source/bindings/scripts/unstable/v8_attributes.py
+++ b/Source/bindings/scripts/unstable/v8_attributes.py
@@ -57,21 +57,20 @@ def generate_attribute(interface, attribute):
has_custom_setter = (not attribute.is_read_only and
'Custom' in extended_attributes and
extended_attributes['Custom'] in [None, 'Setter'])
-
- has_strict_type_checking = (
- ('StrictTypeChecking' in extended_attributes or
- 'StrictTypeChecking' in interface.extended_attributes) and
- v8_types.is_wrapper_type(idl_type))
-
- is_setter_raises_exception = (
- 'RaisesException' in extended_attributes and
- extended_attributes['RaisesException'] in [None, 'Setter'])
-
# [CustomElementCallbacks], [Reflect]
is_custom_element_callbacks = 'CustomElementCallbacks' in extended_attributes
is_reflect = 'Reflect' in extended_attributes
if is_custom_element_callbacks or is_reflect:
includes.add('core/dom/custom/CustomElementCallbackDispatcher.h')
+ # [RaisesException], [RaisesException=Setter]
+ is_setter_raises_exception = (
+ 'RaisesException' in extended_attributes and
+ extended_attributes['RaisesException'] in [None, 'Setter'])
+ # [StrictTypeChecking]
+ has_strict_type_checking = (
+ ('StrictTypeChecking' in extended_attributes or
+ 'StrictTypeChecking' in interface.extended_attributes) and
+ v8_types.is_wrapper_type(idl_type))
if (idl_type == 'EventHandler' and
interface.name in ['Window', 'WorkerGlobalScope'] and
@@ -157,17 +156,20 @@ def generate_getter(interface, attribute, contents):
# exceptions), we need to use a local variable.
# FIXME: check if compilers are smart enough to inline this, and if so,
# always use a local variable (for readability and CG simplicity).
+ release = False
if (attribute.is_nullable or
idl_type == 'EventHandler' or
'CachedAttribute' in extended_attributes or
contents['is_getter_raises_exception']):
contents['cpp_value_original'] = cpp_value
cpp_value = 'jsValue'
+ # EventHandler has special handling
+ if idl_type != 'EventHandler' and v8_types.is_interface_type(idl_type):
+ release = True
def v8_set_return_value_statement(for_main_world=False):
if contents['is_keep_alive_for_gc']:
return 'v8SetReturnValue(info, wrapper)'
- release = attribute.is_nullable and v8_types.is_interface_type(idl_type)
return v8_types.v8_set_return_value(idl_type, cpp_value, extended_attributes=extended_attributes, script_wrappable='imp', release=release, for_main_world=for_main_world)
contents.update({
« no previous file with comments | « no previous file | Source/bindings/tests/idls/TestObjectPython.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698