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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 def cpp_argument(argument): | 216 def cpp_argument(argument): |
217 idl_type = argument.idl_type | 217 idl_type = argument.idl_type |
218 if idl_type.name == 'EventListener': | 218 if idl_type.name == 'EventListener': |
219 if (interface.name == 'EventTarget' and | 219 if (interface.name == 'EventTarget' and |
220 method.name == 'removeEventListener'): | 220 method.name == 'removeEventListener'): |
221 # FIXME: remove this special case by moving get() into | 221 # FIXME: remove this special case by moving get() into |
222 # EventTarget::removeEventListener | 222 # EventTarget::removeEventListener |
223 return '%s.get()' % argument.name | 223 return '%s.get()' % argument.name |
224 return argument.name | 224 return argument.name |
225 if (idl_type.is_callback_interface or | 225 if (idl_type.is_callback_interface or |
226 idl_type.name in ['NodeFilter', 'XPathNSResolver']): | 226 idl_type.name in ['NodeFilter', 'NodeFilterOrNull', |
Jens Widell
2014/06/25 14:01:02
For both NodeFilter and XPathNSResolver, the local
| |
227 'XPathNSResolver', 'XPathNSResolverOrNull']): | |
227 # FIXME: remove this special case | 228 # FIXME: remove this special case |
228 return '%s.release()' % argument.name | 229 return '%s.release()' % argument.name |
229 return argument.name | 230 return argument.name |
230 | 231 |
231 # Truncate omitted optional arguments | 232 # Truncate omitted optional arguments |
232 arguments = method.arguments[:number_of_arguments] | 233 arguments = method.arguments[:number_of_arguments] |
233 cpp_arguments = [] | 234 cpp_arguments = [] |
234 if method.is_constructor: | 235 if method.is_constructor: |
235 call_with_values = interface.extended_attributes.get('ConstructorCallWit h') | 236 call_with_values = interface.extended_attributes.get('ConstructorCallWit h') |
236 else: | 237 else: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 | 324 |
324 | 325 |
325 def union_arguments(idl_type): | 326 def union_arguments(idl_type): |
326 """Return list of ['result0Enabled', 'result0', 'result1Enabled', ...] for u nion types, for use in setting return value""" | 327 """Return list of ['result0Enabled', 'result0', 'result1Enabled', ...] for u nion types, for use in setting return value""" |
327 return [arg | 328 return [arg |
328 for i in range(len(idl_type.member_types)) | 329 for i in range(len(idl_type.member_types)) |
329 for arg in ['result%sEnabled' % i, 'result%s' % i]] | 330 for arg in ['result%sEnabled' % i, 'result%s' % i]] |
330 | 331 |
331 IdlType.union_arguments = property(lambda self: None) | 332 IdlType.union_arguments = property(lambda self: None) |
332 IdlUnionType.union_arguments = property(union_arguments) | 333 IdlUnionType.union_arguments = property(union_arguments) |
OLD | NEW |