Chromium Code Reviews| Index: Source/bindings/scripts/unstable/v8_interface.py |
| diff --git a/Source/bindings/scripts/unstable/v8_interface.py b/Source/bindings/scripts/unstable/v8_interface.py |
| index 0b15a9b572d070334c237425863208738da8737c..9fdcf74f5b18a94ee079e8ead3bc40c00ae92429 100644 |
| --- a/Source/bindings/scripts/unstable/v8_interface.py |
| +++ b/Source/bindings/scripts/unstable/v8_interface.py |
| @@ -39,7 +39,7 @@ import v8_attributes |
| from v8_globals import includes |
| import v8_methods |
| import v8_types |
| -from v8_types import inherits_interface |
| +from v8_types import inherits_interface, is_interface_type |
| import v8_utilities |
| from v8_utilities import capitalize, conditional_string, cpp_name, has_extended_attribute_value, runtime_enabled_function_name |
| @@ -382,7 +382,7 @@ def overload_check_argument(index, argument): |
| if argument['is_nullable']: |
| type_check = ' || '.join(['%s->IsNull()' % cpp_value, type_check]) |
| return type_check |
| - if v8_types.is_interface_type(idl_type): |
| + if is_interface_type(idl_type): |
| # Non-wrapper types are just objects: we don't distinguish type |
| type_check = '%s->IsObject()' % cpp_value |
| if argument['is_nullable']: |
| @@ -491,10 +491,14 @@ def property_getter(getter): |
| def is_null_expression(idl_type): |
| if idl_type == 'DOMString': |
| return 'element.isNull()' |
| - return None |
| + if is_interface_type(idl_type): |
| + return '!element' |
| + return '' |
| idl_type = getter.idl_type |
| extended_attributes = getter.extended_attributes |
| + element = 'element.release()' if is_interface_type(idl_type) else 'element' |
| + |
| return { |
| 'cpp_type': v8_types.cpp_type(idl_type), |
| 'is_custom': |
| @@ -509,16 +513,19 @@ def property_getter(getter): |
| 'is_null_expression': is_null_expression(idl_type), |
| 'is_raises_exception': 'RaisesException' in extended_attributes, |
| 'name': cpp_name(getter), |
| - 'v8_set_return_value': v8_types.v8_set_return_value(idl_type, 'element', extended_attributes=extended_attributes, script_wrappable='collection'), |
| + 'v8_set_return_value': v8_types.v8_set_return_value(idl_type, element, extended_attributes=extended_attributes, script_wrappable='collection'), |
| } |
| def property_setter(setter): |
| idl_type = setter.arguments[1].idl_type |
| extended_attributes = setter.extended_attributes |
| + is_raises_exception = 'RaisesException' in extended_attributes |
| return { |
| 'is_custom': 'Custom' in extended_attributes, |
| - 'is_raises_exception': 'RaisesException' in extended_attributes, |
| + 'has_exception_state': is_raises_exception or |
| + v8_types.is_integer_type(idl_type), |
|
haraken
2014/01/30 10:55:25
Let me confirm: Did we decide that we should impli
Nils Barth (inactive)
2014/01/30 11:00:50
Yes, we raise exceptions for integer setters (for
|
| + 'is_raises_exception': is_raises_exception, |
| 'name': cpp_name(setter), |
| 'v8_value_to_local_cpp_value': v8_types.v8_value_to_local_cpp_value( |
| idl_type, extended_attributes, 'jsValue', 'propertyValue'), |