| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 'is_static': is_static, | 94 'is_static': is_static, |
| 95 'measure_as': v8_utilities.measure_as(method), # [MeasureAs] | 95 'measure_as': v8_utilities.measure_as(method), # [MeasureAs] |
| 96 'name': name, | 96 'name': name, |
| 97 'number_of_arguments': len(arguments), | 97 'number_of_arguments': len(arguments), |
| 98 'number_of_required_arguments': len([ | 98 'number_of_required_arguments': len([ |
| 99 argument for argument in arguments | 99 argument for argument in arguments |
| 100 if not (argument.is_optional or argument.is_variadic)]), | 100 if not (argument.is_optional or argument.is_variadic)]), |
| 101 'number_of_required_or_variadic_arguments': len([ | 101 'number_of_required_or_variadic_arguments': len([ |
| 102 argument for argument in arguments | 102 argument for argument in arguments |
| 103 if not argument.is_optional]), | 103 if not argument.is_optional]), |
| 104 'per_context_enabled_function_name': v8_utilities.per_context_enabled_fu
nction_name(method), # [PerContextEnabled] |
| 104 'property_attributes': property_attributes(method), | 105 'property_attributes': property_attributes(method), |
| 105 'signature': signature, | 106 'signature': signature, |
| 106 'v8_set_return_value': v8_set_return_value(method, this_cpp_value), | 107 'v8_set_return_value': v8_set_return_value(method, this_cpp_value), |
| 107 } | 108 } |
| 108 return contents | 109 return contents |
| 109 | 110 |
| 110 | 111 |
| 111 def generate_argument(interface, method, argument, index): | 112 def generate_argument(interface, method, argument, index): |
| 112 extended_attributes = argument.extended_attributes | 113 extended_attributes = argument.extended_attributes |
| 113 idl_type = argument.idl_type | 114 idl_type = argument.idl_type |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( | 194 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( |
| 194 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) | 195 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) |
| 195 # [Default=NullString] | 196 # [Default=NullString] |
| 196 if (argument.is_optional and idl_type == 'DOMString' and | 197 if (argument.is_optional and idl_type == 'DOMString' and |
| 197 extended_attributes.get('Default') == 'NullString'): | 198 extended_attributes.get('Default') == 'NullString'): |
| 198 v8_value = 'argumentOrNull(info, %s)' % index | 199 v8_value = 'argumentOrNull(info, %s)' % index |
| 199 else: | 200 else: |
| 200 v8_value = 'info[%s]' % index | 201 v8_value = 'info[%s]' % index |
| 201 return v8_types.v8_value_to_local_cpp_value( | 202 return v8_types.v8_value_to_local_cpp_value( |
| 202 idl_type, argument.extended_attributes, v8_value, name, index=index) | 203 idl_type, argument.extended_attributes, v8_value, name, index=index) |
| OLD | NEW |