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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 'number_of_arguments': len(constructor.arguments), | 941 'number_of_arguments': len(constructor.arguments), |
942 } | 942 } |
943 | 943 |
944 | 944 |
945 def constructor_argument_list(interface, constructor): | 945 def constructor_argument_list(interface, constructor): |
946 # FIXME: unify with dart_methods.cpp_argument. | 946 # FIXME: unify with dart_methods.cpp_argument. |
947 | 947 |
948 def cpp_argument(argument): | 948 def cpp_argument(argument): |
949 argument_name = dart_types.check_reserved_name(argument.name) | 949 argument_name = dart_types.check_reserved_name(argument.name) |
950 idl_type = argument.idl_type | 950 idl_type = argument.idl_type |
951 if isinstance(idl_type, IdlArrayType): | 951 # FIXMEDART: there has to be a cleaner way to check for arraylike |
| 952 # types such as Uint8ClampedArray. |
| 953 if isinstance(idl_type, IdlArrayType) or idl_type.preprocessed_type.is_t
yped_array_type: |
952 return '%s.get()' % argument_name | 954 return '%s.get()' % argument_name |
953 | 955 |
954 return argument_name | 956 return argument_name |
955 | 957 |
956 arguments = [] | 958 arguments = [] |
957 # [ConstructorCallWith=ExecutionContext] | 959 # [ConstructorCallWith=ExecutionContext] |
958 if DartUtilities.has_extended_attribute_value(interface, 'ConstructorCallWit
h', 'ExecutionContext'): | 960 if DartUtilities.has_extended_attribute_value(interface, 'ConstructorCallWit
h', 'ExecutionContext'): |
959 arguments.append('context') | 961 arguments.append('context') |
960 # [ConstructorCallWith=Document] | 962 # [ConstructorCallWith=Document] |
961 if DartUtilities.has_extended_attribute_value(interface, 'ConstructorCallWit
h', 'Document'): | 963 if DartUtilities.has_extended_attribute_value(interface, 'ConstructorCallWit
h', 'Document'): |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 deleter = next( | 1229 deleter = next( |
1228 method | 1230 method |
1229 for method in interface.operations | 1231 for method in interface.operations |
1230 if ('deleter' in method.specials and | 1232 if ('deleter' in method.specials and |
1231 len(method.arguments) == 1 and | 1233 len(method.arguments) == 1 and |
1232 str(method.arguments[0].idl_type) == 'DOMString')) | 1234 str(method.arguments[0].idl_type) == 'DOMString')) |
1233 except StopIteration: | 1235 except StopIteration: |
1234 return None | 1236 return None |
1235 | 1237 |
1236 return property_deleter(deleter) | 1238 return property_deleter(deleter) |
OLD | NEW |