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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 323 |
324 | 324 |
325 def is_traceable(idl_type): | 325 def is_traceable(idl_type): |
326 return (idl_type.is_garbage_collected | 326 return (idl_type.is_garbage_collected |
327 or idl_type.is_will_be_garbage_collected | 327 or idl_type.is_will_be_garbage_collected |
328 or idl_type.is_dictionary) | 328 or idl_type.is_dictionary) |
329 | 329 |
330 IdlTypeBase.is_traceable = property(is_traceable) | 330 IdlTypeBase.is_traceable = property(is_traceable) |
331 IdlUnionType.is_traceable = property( | 331 IdlUnionType.is_traceable = property( |
332 lambda self: any((member_type.is_traceable for member_type in self.member_ty
pes))) | 332 lambda self: any((member_type.is_traceable for member_type in self.member_ty
pes))) |
| 333 IdlArrayOrSequenceType.is_traceable = property( |
| 334 lambda self: self.element_type.is_traceable) |
333 | 335 |
334 | 336 |
335 ################################################################################ | 337 ################################################################################ |
336 # Includes | 338 # Includes |
337 ################################################################################ | 339 ################################################################################ |
338 | 340 |
339 def includes_for_cpp_class(class_name, relative_dir_posix): | 341 def includes_for_cpp_class(class_name, relative_dir_posix): |
340 return set([posixpath.join('bindings', relative_dir_posix, class_name + '.h'
)]) | 342 return set([posixpath.join('bindings', relative_dir_posix, class_name + '.h'
)]) |
341 | 343 |
342 | 344 |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 number_of_nullable_member_types_union) | 920 number_of_nullable_member_types_union) |
919 | 921 |
920 | 922 |
921 def includes_nullable_type_union(idl_type): | 923 def includes_nullable_type_union(idl_type): |
922 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type | 924 # http://heycam.github.io/webidl/#dfn-includes-a-nullable-type |
923 return idl_type.number_of_nullable_member_types == 1 | 925 return idl_type.number_of_nullable_member_types == 1 |
924 | 926 |
925 IdlTypeBase.includes_nullable_type = False | 927 IdlTypeBase.includes_nullable_type = False |
926 IdlNullableType.includes_nullable_type = True | 928 IdlNullableType.includes_nullable_type = True |
927 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) | 929 IdlUnionType.includes_nullable_type = property(includes_nullable_type_union) |
OLD | NEW |