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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 # [CallWith=ScriptState], [RaisesException] | 345 # [CallWith=ScriptState], [RaisesException] |
346 if use_local_result(method): | 346 if use_local_result(method): |
347 if idl_type.is_explicit_nullable: | 347 if idl_type.is_explicit_nullable: |
348 # result is of type Nullable<T> | 348 # result is of type Nullable<T> |
349 cpp_value = 'result.get()' | 349 cpp_value = 'result.get()' |
350 else: | 350 else: |
351 cpp_value = 'result' | 351 cpp_value = 'result' |
352 release = idl_type.release | 352 release = idl_type.release |
353 | 353 |
354 script_wrappable = 'impl' if inherits_interface(interface_name, 'Node') else
'' | 354 script_wrappable = 'impl' if inherits_interface(interface_name, 'Node') else
'' |
355 return idl_type.v8_set_return_value(cpp_value, extended_attributes, script_w
rappable=script_wrappable, release=release, for_main_world=for_main_world) | 355 return idl_type.v8_set_return_value(cpp_value, extended_attributes, script_w
rappable=script_wrappable, release=release, for_main_world=for_main_world, is_st
atic=method.is_static) |
356 | 356 |
357 | 357 |
358 def v8_value_to_local_cpp_variadic_value(method, argument, index, return_promise
): | 358 def v8_value_to_local_cpp_variadic_value(method, argument, index, return_promise
): |
359 assert argument.is_variadic | 359 assert argument.is_variadic |
360 idl_type = argument.idl_type | 360 idl_type = argument.idl_type |
361 this_cpp_type = idl_type.cpp_type | 361 this_cpp_type = idl_type.cpp_type |
362 | 362 |
363 if method.returns_promise: | 363 if method.returns_promise: |
364 check_expression = 'exceptionState.hadException()' | 364 check_expression = 'exceptionState.hadException()' |
365 else: | 365 else: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 return method.idl_type and method.idl_type.name == 'Promise' | 452 return method.idl_type and method.idl_type.name == 'Promise' |
453 | 453 |
454 IdlOperation.returns_promise = property(method_returns_promise) | 454 IdlOperation.returns_promise = property(method_returns_promise) |
455 | 455 |
456 | 456 |
457 def argument_conversion_needs_exception_state(method, argument): | 457 def argument_conversion_needs_exception_state(method, argument): |
458 idl_type = argument.idl_type | 458 idl_type = argument.idl_type |
459 return (idl_type.v8_conversion_needs_exception_state or | 459 return (idl_type.v8_conversion_needs_exception_state or |
460 argument.is_variadic or | 460 argument.is_variadic or |
461 (method.returns_promise and idl_type.is_string_type)) | 461 (method.returns_promise and idl_type.is_string_type)) |
OLD | NEW |