| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 idl_type == 'EventHandler' or | 163 idl_type == 'EventHandler' or |
| 164 'CachedAttribute' in extended_attributes or | 164 'CachedAttribute' in extended_attributes or |
| 165 contents['is_getter_raises_exception']): | 165 contents['is_getter_raises_exception']): |
| 166 contents['cpp_value_original'] = cpp_value | 166 contents['cpp_value_original'] = cpp_value |
| 167 cpp_value = 'jsValue' | 167 cpp_value = 'jsValue' |
| 168 | 168 |
| 169 if contents['is_keep_alive_for_gc']: | 169 if contents['is_keep_alive_for_gc']: |
| 170 v8_set_return_value_statement = 'v8SetReturnValue(info, wrapper)' | 170 v8_set_return_value_statement = 'v8SetReturnValue(info, wrapper)' |
| 171 includes.add('bindings/v8/V8HiddenPropertyName.h') | 171 includes.add('bindings/v8/V8HiddenPropertyName.h') |
| 172 else: | 172 else: |
| 173 v8_set_return_value_statement = v8_types.v8_set_return_value(idl_type, c
pp_value, extended_attributes=extended_attributes, script_wrappable='imp') | 173 if attribute.is_nullable and v8_types.is_interface_type(idl_type): |
| 174 set_cpp_value = 'jsValue.release()' |
| 175 else: |
| 176 set_cpp_value = cpp_value |
| 177 v8_set_return_value_statement = v8_types.v8_set_return_value(idl_type, s
et_cpp_value, extended_attributes=extended_attributes, script_wrappable='imp') |
| 174 | 178 |
| 175 contents.update({ | 179 contents.update({ |
| 176 'cpp_value': cpp_value, | 180 'cpp_value': cpp_value, |
| 177 'v8_set_return_value': v8_set_return_value_statement, | 181 'v8_set_return_value': v8_set_return_value_statement, |
| 178 }) | 182 }) |
| 179 | 183 |
| 180 | 184 |
| 181 def getter_expression(interface, attribute, contents): | 185 def getter_expression(interface, attribute, contents): |
| 182 arguments = [] | 186 arguments = [] |
| 183 this_getter_base_name = getter_base_name(attribute, arguments) | 187 this_getter_base_name = getter_base_name(attribute, arguments) |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 property_attributes_list.append('v8::DontDelete') | 348 property_attributes_list.append('v8::DontDelete') |
| 345 return property_attributes_list or ['v8::None'] | 349 return property_attributes_list or ['v8::None'] |
| 346 | 350 |
| 347 | 351 |
| 348 ################################################################################ | 352 ################################################################################ |
| 349 # Constructors | 353 # Constructors |
| 350 ################################################################################ | 354 ################################################################################ |
| 351 | 355 |
| 352 def is_constructor_attribute(attribute): | 356 def is_constructor_attribute(attribute): |
| 353 return attribute.idl_type.endswith('Constructor') | 357 return attribute.idl_type.endswith('Constructor') |
| OLD | NEW |