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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 cpp_arguments.append('exceptionState') | 380 cpp_arguments.append('exceptionState') |
381 | 381 |
382 # If a method returns an IDL dictionary or union type, the return value is | 382 # If a method returns an IDL dictionary or union type, the return value is |
383 # passed as an argument to impl classes. | 383 # passed as an argument to impl classes. |
384 idl_type = method.idl_type | 384 idl_type = method.idl_type |
385 if idl_type and idl_type.use_output_parameter_for_result: | 385 if idl_type and idl_type.use_output_parameter_for_result: |
386 cpp_arguments.append('result') | 386 cpp_arguments.append('result') |
387 | 387 |
388 if method.name == 'Constructor': | 388 if method.name == 'Constructor': |
389 base_name = 'create' | 389 base_name = 'create' |
| 390 elif method.name == 'HTMLConstructor': |
| 391 base_name = 'HTMLConstructor' |
390 elif method.name == 'NamedConstructor': | 392 elif method.name == 'NamedConstructor': |
391 base_name = 'createForJSConstructor' | 393 base_name = 'createForJSConstructor' |
392 elif 'ImplementedInPrivateScript' in method.extended_attributes: | 394 elif 'ImplementedInPrivateScript' in method.extended_attributes: |
393 base_name = '%sMethod' % method.name | 395 base_name = '%sMethod' % method.name |
394 else: | 396 else: |
395 base_name = v8_utilities.cpp_name(method) | 397 base_name = v8_utilities.cpp_name(method) |
396 | 398 |
397 cpp_method_name = v8_utilities.scoped_name(interface, method, base_name) | 399 cpp_method_name = v8_utilities.scoped_name(interface, method, base_name) |
398 return '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments)) | 400 return '%s(%s)' % (cpp_method_name, ', '.join(cpp_arguments)) |
399 | 401 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 return method.idl_type and method.idl_type.name == 'Promise' | 520 return method.idl_type and method.idl_type.name == 'Promise' |
519 | 521 |
520 IdlOperation.returns_promise = property(method_returns_promise) | 522 IdlOperation.returns_promise = property(method_returns_promise) |
521 | 523 |
522 | 524 |
523 def argument_conversion_needs_exception_state(method, argument): | 525 def argument_conversion_needs_exception_state(method, argument): |
524 idl_type = argument.idl_type | 526 idl_type = argument.idl_type |
525 return (idl_type.v8_conversion_needs_exception_state or | 527 return (idl_type.v8_conversion_needs_exception_state or |
526 argument.is_variadic or | 528 argument.is_variadic or |
527 (method.returns_promise and idl_type.is_string_type)) | 529 (method.returns_promise and idl_type.is_string_type)) |
OLD | NEW |