| 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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 | 890 |
| 891 # (Perform automatic type conversion, in order. If any of these match, | 891 # (Perform automatic type conversion, in order. If any of these match, |
| 892 # that’s the end, and no other tests are needed.) To keep this code simple, | 892 # that’s the end, and no other tests are needed.) To keep this code simple, |
| 893 # we rely on the C++ compiler's dead code elimination to deal with the | 893 # we rely on the C++ compiler's dead code elimination to deal with the |
| 894 # redundancy if both cases below trigger. | 894 # redundancy if both cases below trigger. |
| 895 | 895 |
| 896 # 11. Otherwise: if there is an entry in S that has one of the following | 896 # 11. Otherwise: if there is an entry in S that has one of the following |
| 897 # types at position i of its type list, | 897 # types at position i of its type list, |
| 898 # • DOMString | 898 # • DOMString |
| 899 # • ByteString | 899 # • ByteString |
| 900 # • ScalarValueString [a DOMString typedef, per definition.] | 900 # • USVString |
| 901 # • an enumeration type | 901 # • an enumeration type |
| 902 try: | 902 try: |
| 903 method = next(method for idl_type, method in idl_types_methods | 903 method = next(method for idl_type, method in idl_types_methods |
| 904 if idl_type.is_string_type or idl_type.is_enum) | 904 if idl_type.is_string_type or idl_type.is_enum) |
| 905 yield 'true', method | 905 yield 'true', method |
| 906 except StopIteration: | 906 except StopIteration: |
| 907 pass | 907 pass |
| 908 | 908 |
| 909 # 12. Otherwise: if there is an entry in S that has one of the following | 909 # 12. Otherwise: if there is an entry in S that has one of the following |
| 910 # types at position i of its type list, | 910 # types at position i of its type list, |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 deleter = next( | 1222 deleter = next( |
| 1223 method | 1223 method |
| 1224 for method in interface.operations | 1224 for method in interface.operations |
| 1225 if ('deleter' in method.specials and | 1225 if ('deleter' in method.specials and |
| 1226 len(method.arguments) == 1 and | 1226 len(method.arguments) == 1 and |
| 1227 str(method.arguments[0].idl_type) == 'DOMString')) | 1227 str(method.arguments[0].idl_type) == 'DOMString')) |
| 1228 except StopIteration: | 1228 except StopIteration: |
| 1229 return None | 1229 return None |
| 1230 | 1230 |
| 1231 return property_deleter(deleter) | 1231 return property_deleter(deleter) |
| OLD | NEW |