| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 """IDL type handling. | 4 """IDL type handling. |
| 5 | 5 |
| 6 Classes: | 6 Classes: |
| 7 IdlType | 7 IdlType |
| 8 IdlUnionType | 8 IdlUnionType |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 @property | 325 @property |
| 326 def is_sequence(self): | 326 def is_sequence(self): |
| 327 # We do not support sequences of union types | 327 # We do not support sequences of union types |
| 328 return False | 328 return False |
| 329 | 329 |
| 330 @property | 330 @property |
| 331 def is_union_type(self): | 331 def is_union_type(self): |
| 332 return True | 332 return True |
| 333 | 333 |
| 334 @property | 334 @property |
| 335 def may_raise_exception_on_conversion(self): |
| 336 return False |
| 337 |
| 338 @property |
| 335 def name(self): | 339 def name(self): |
| 336 return 'Or'.join(member_type.name for member_type in self.member_types) | 340 return 'Or'.join(member_type.name for member_type in self.member_types) |
| 337 | 341 |
| 338 def resolve_typedefs(self, typedefs): | 342 def resolve_typedefs(self, typedefs): |
| 339 self.member_types = [ | 343 self.member_types = [ |
| 340 typedefs.get(member_type, member_type) | 344 typedefs.get(member_type, member_type) |
| 341 for member_type in self.member_types] | 345 for member_type in self.member_types] |
| 342 return self | 346 return self |
| OLD | NEW |