| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 if argument.idl_type in ['NodeFilter', 'XPathNSResolver']: | 160 if argument.idl_type in ['NodeFilter', 'XPathNSResolver']: |
| 161 # FIXME: remove this special case | 161 # FIXME: remove this special case |
| 162 return '%s.get()' % argument.name | 162 return '%s.get()' % argument.name |
| 163 return argument.name | 163 return argument.name |
| 164 | 164 |
| 165 # Truncate omitted optional arguments | 165 # Truncate omitted optional arguments |
| 166 arguments = method.arguments[:number_of_arguments] | 166 arguments = method.arguments[:number_of_arguments] |
| 167 cpp_arguments = v8_utilities.call_with_arguments(method) | 167 cpp_arguments = v8_utilities.call_with_arguments(method) |
| 168 cpp_arguments.extend(cpp_argument(argument) for argument in arguments) | 168 cpp_arguments.extend(cpp_argument(argument) for argument in arguments) |
| 169 if 'RaisesException' in method.extended_attributes: | 169 if 'RaisesException' in method.extended_attributes: |
| 170 cpp_arguments.append('es') | 170 cpp_arguments.append('exceptionState') |
| 171 | 171 |
| 172 cpp_method_name = v8_utilities.scoped_name(interface, method, v8_utilities.c
pp_name(method)) | 172 cpp_method_name = v8_utilities.scoped_name(interface, method, v8_utilities.c
pp_name(method)) |
| 173 return '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments)) | 173 return '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments)) |
| 174 | 174 |
| 175 | 175 |
| 176 def v8_set_return_value(method, cpp_value): | 176 def v8_set_return_value(method, cpp_value): |
| 177 idl_type = method.idl_type | 177 idl_type = method.idl_type |
| 178 if idl_type == 'void': | 178 if idl_type == 'void': |
| 179 return None | 179 return None |
| 180 # [CallWith=ScriptState] | 180 # [CallWith=ScriptState] |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( | 226 return 'V8TRYCATCH_VOID(Vector<{cpp_type}>, {name}, toNativeArguments<{c
pp_type}>(info, {index}))'.format( |
| 227 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) | 227 cpp_type=v8_types.cpp_type(idl_type), name=name, index=index) |
| 228 # [Default=NullString] | 228 # [Default=NullString] |
| 229 if (argument.is_optional and idl_type == 'DOMString' and | 229 if (argument.is_optional and idl_type == 'DOMString' and |
| 230 extended_attributes.get('Default') == 'NullString'): | 230 extended_attributes.get('Default') == 'NullString'): |
| 231 v8_value = 'argumentOrNull(info, %s)' % index | 231 v8_value = 'argumentOrNull(info, %s)' % index |
| 232 else: | 232 else: |
| 233 v8_value = 'info[%s]' % index | 233 v8_value = 'info[%s]' % index |
| 234 return v8_types.v8_value_to_local_cpp_value( | 234 return v8_types.v8_value_to_local_cpp_value( |
| 235 idl_type, argument.extended_attributes, v8_value, name, index=index) | 235 idl_type, argument.extended_attributes, v8_value, name, index=index) |
| OLD | NEW |