| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 if idl_type.is_typed_array_type: | 166 if idl_type.is_typed_array_type: |
| 167 return '%s.get()' % argument_name | 167 return '%s.get()' % argument_name |
| 168 | 168 |
| 169 if idl_type.name == 'EventListener': | 169 if idl_type.name == 'EventListener': |
| 170 if (interface.name == 'EventTarget' and | 170 if (interface.name == 'EventTarget' and |
| 171 method.name == 'removeEventListener'): | 171 method.name == 'removeEventListener'): |
| 172 # FIXME: remove this special case by moving get() into | 172 # FIXME: remove this special case by moving get() into |
| 173 # EventTarget::removeEventListener | 173 # EventTarget::removeEventListener |
| 174 return '%s.get()' % argument_name | 174 return '%s.get()' % argument_name |
| 175 return argument.name | 175 return argument.name |
| 176 if (idl_type.is_callback_interface or | 176 if (idl_type.name in ['NodeFilter', 'NodeFilterOrNull', |
| 177 idl_type.name in ['NodeFilter', 'XPathNSResolver']): | 177 'XPathNSResolver', 'XPathNSResolverOrNull']): |
| 178 # FIXME: remove this special case | 178 # FIXME: remove this special case |
| 179 return '%s.release()' % argument_name | 179 return '%s.release()' % argument_name |
| 180 return argument_name | 180 return argument_name |
| 181 | 181 |
| 182 # Truncate omitted optional arguments | 182 # Truncate omitted optional arguments |
| 183 arguments = method.arguments[:number_of_arguments] | 183 arguments = method.arguments[:number_of_arguments] |
| 184 if method.is_constructor: | 184 if method.is_constructor: |
| 185 call_with_values = interface.extended_attributes.get('ConstructorCallWit
h') | 185 call_with_values = interface.extended_attributes.get('ConstructorCallWit
h') |
| 186 else: | 186 else: |
| 187 call_with_values = method.extended_attributes.get('CallWith') | 187 call_with_values = method.extended_attributes.get('CallWith') |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 # There is also some logic in systemnative.py to force a null check | 263 # There is also some logic in systemnative.py to force a null check |
| 264 # for the useCapture argument of those same methods that we may need to | 264 # for the useCapture argument of those same methods that we may need to |
| 265 # pull over. | 265 # pull over. |
| 266 null_check = ((argument.is_optional and idl_type.is_callback_interface) or | 266 null_check = ((argument.is_optional and idl_type.is_callback_interface) or |
| 267 (idl_type.name == 'Dictionary') or | 267 (idl_type.name == 'Dictionary') or |
| 268 (argument.default_value and argument.default_value.is_null)) | 268 (argument.default_value and argument.default_value.is_null)) |
| 269 | 269 |
| 270 return idl_type.dart_value_to_local_cpp_value( | 270 return idl_type.dart_value_to_local_cpp_value( |
| 271 extended_attributes, name, null_check, has_type_checking_interface, | 271 extended_attributes, name, null_check, has_type_checking_interface, |
| 272 index=index, auto_scope=auto_scope) | 272 index=index, auto_scope=auto_scope) |
| OLD | NEW |