Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: Source/bindings/scripts/v8_types.py

Issue 606603002: Conversion of Promise is trivial (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 476
477 IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_excep tion_state) 477 IdlType.v8_conversion_needs_exception_state = property(v8_conversion_needs_excep tion_state)
478 IdlArrayOrSequenceType.v8_conversion_needs_exception_state = True 478 IdlArrayOrSequenceType.v8_conversion_needs_exception_state = True
479 479
480 480
481 TRIVIAL_CONVERSIONS = frozenset([ 481 TRIVIAL_CONVERSIONS = frozenset([
482 'any', 482 'any',
483 'boolean', 483 'boolean',
484 'Dictionary', 484 'Dictionary',
485 'NodeFilter', 485 'NodeFilter',
486 'XPathNSResolver' 486 'XPathNSResolver',
487 'Promise'
487 ]) 488 ])
488 489
489 490
490 def v8_conversion_is_trivial(idl_type): 491 def v8_conversion_is_trivial(idl_type):
491 # The conversion is a simple expression that returns the converted value and 492 # The conversion is a simple expression that returns the converted value and
492 # cannot raise an exception. 493 # cannot raise an exception.
493 return (idl_type.base_type in TRIVIAL_CONVERSIONS or 494 return (idl_type.base_type in TRIVIAL_CONVERSIONS or
494 idl_type.is_wrapper_type) 495 idl_type.is_wrapper_type)
495 496
496 IdlType.v8_conversion_is_trivial = property(v8_conversion_is_trivial) 497 IdlType.v8_conversion_is_trivial = property(v8_conversion_is_trivial)
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 844
844 845
845 def is_explicit_nullable(idl_type): 846 def is_explicit_nullable(idl_type):
846 # Nullable type that isn't implicit nullable (see above.) For such types, 847 # Nullable type that isn't implicit nullable (see above.) For such types,
847 # we use Nullable<T> or similar explicit ways to represent a null value. 848 # we use Nullable<T> or similar explicit ways to represent a null value.
848 return idl_type.is_nullable and not idl_type.is_implicit_nullable 849 return idl_type.is_nullable and not idl_type.is_implicit_nullable
849 850
850 IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable) 851 IdlTypeBase.is_implicit_nullable = property(is_implicit_nullable)
851 IdlUnionType.is_implicit_nullable = False 852 IdlUnionType.is_implicit_nullable = False
852 IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable) 853 IdlTypeBase.is_explicit_nullable = property(is_explicit_nullable)
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/tests/results/core/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698