OLD | NEW |
1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
2 # coding=utf-8 | 2 # coding=utf-8 |
3 # | 3 # |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 yield test, method | 728 yield test, method |
729 | 729 |
730 # 8. Otherwise: if V is any kind of object except for a native Date object, | 730 # 8. Otherwise: if V is any kind of object except for a native Date object, |
731 # a native RegExp object, and there is an entry in S that has one of the | 731 # a native RegExp object, and there is an entry in S that has one of the |
732 # following types at position i of its type list, | 732 # following types at position i of its type list, |
733 # • an array type | 733 # • an array type |
734 # • a sequence type | 734 # • a sequence type |
735 # ... | 735 # ... |
736 # • a dictionary | 736 # • a dictionary |
737 try: | 737 try: |
738 # FIXME: IDL dictionary not implemented, so use Blink Dictionary | |
739 # http://crbug.com/321462 | |
740 idl_type, method = next((idl_type, method) | 738 idl_type, method = next((idl_type, method) |
741 for idl_type, method in idl_types_methods | 739 for idl_type, method in idl_types_methods |
742 if (idl_type.native_array_element_type or | 740 if (idl_type.native_array_element_type or |
| 741 idl_type.is_dictionary or |
743 idl_type.name == 'Dictionary')) | 742 idl_type.name == 'Dictionary')) |
744 if idl_type.native_array_element_type: | 743 if idl_type.native_array_element_type: |
745 # (We test for Array instead of generic Object to type-check.) | 744 # (We test for Array instead of generic Object to type-check.) |
746 # FIXME: test for Object during resolution, then have type check for | 745 # FIXME: test for Object during resolution, then have type check for |
747 # Array in overloaded method: http://crbug.com/262383 | 746 # Array in overloaded method: http://crbug.com/262383 |
748 test = '%s->IsArray()' % cpp_value | 747 test = '%s->IsArray()' % cpp_value |
749 else: | 748 else: |
750 # FIXME: should be '{1}->IsObject() && !{1}->IsDate() && !{1}->IsReg
Exp()'.format(cpp_value) | 749 # FIXME: should be '{1}->IsObject() && !{1}->IsDate() && !{1}->IsReg
Exp()'.format(cpp_value) |
751 # FIXME: the IsDate and IsRegExp checks can be skipped if we've | 750 # FIXME: the IsDate and IsRegExp checks can be skipped if we've |
752 # already generated tests for them. | 751 # already generated tests for them. |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 deleter = next( | 1110 deleter = next( |
1112 method | 1111 method |
1113 for method in interface.operations | 1112 for method in interface.operations |
1114 if ('deleter' in method.specials and | 1113 if ('deleter' in method.specials and |
1115 len(method.arguments) == 1 and | 1114 len(method.arguments) == 1 and |
1116 str(method.arguments[0].idl_type) == 'DOMString')) | 1115 str(method.arguments[0].idl_type) == 'DOMString')) |
1117 except StopIteration: | 1116 except StopIteration: |
1118 return None | 1117 return None |
1119 | 1118 |
1120 return property_deleter(deleter) | 1119 return property_deleter(deleter) |
OLD | NEW |