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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 # has one of the following types at position i of its type list, | 992 # has one of the following types at position i of its type list, |
993 # • a nullable type | 993 # • a nullable type |
994 try: | 994 try: |
995 method = next(method for idl_type, method in idl_types_methods | 995 method = next(method for idl_type, method in idl_types_methods |
996 if idl_type.is_nullable) | 996 if idl_type.is_nullable) |
997 test = 'isUndefinedOrNull(%s)' % cpp_value | 997 test = 'isUndefinedOrNull(%s)' % cpp_value |
998 yield test, method | 998 yield test, method |
999 except StopIteration: | 999 except StopIteration: |
1000 pass | 1000 pass |
1001 | 1001 |
| 1002 # Special case SmallTypedArray, as this is a ArrayBufferView with special |
| 1003 # properties that would otherwise be covered by 4. |
| 1004 for idl_type, method in ((idl_type, method) |
| 1005 for idl_type, method in idl_types_methods |
| 1006 if idl_type.name == 'SmallTypedArray'): |
| 1007 test = 'V8ArrayBufferView::hasInstance({cpp_value}, info.GetIsolate()) &
& !v8::ArrayBufferView::Cast(*{cpp_value})->HasBuffer()'.format(idl_type=idl_typ
e.base_type, cpp_value=cpp_value) |
| 1008 yield test, method |
| 1009 |
1002 # 4. Otherwise: if V is a platform object – but not a platform array | 1010 # 4. Otherwise: if V is a platform object – but not a platform array |
1003 # object – and there is an entry in S that has one of the following | 1011 # object – and there is an entry in S that has one of the following |
1004 # types at position i of its type list, | 1012 # types at position i of its type list, |
1005 # • an interface type that V implements | 1013 # • an interface type that V implements |
1006 # (Unlike most of these tests, this can return multiple methods, since we | 1014 # (Unlike most of these tests, this can return multiple methods, since we |
1007 # test if it implements an interface. Thus we need a for loop, not a next.) | 1015 # test if it implements an interface. Thus we need a for loop, not a next.) |
1008 # (We distinguish wrapper types from built-in interface types.) | 1016 # (We distinguish wrapper types from built-in interface types.) |
1009 for idl_type, method in ((idl_type, method) | 1017 for idl_type, method in ((idl_type, method) |
1010 for idl_type, method in idl_types_methods | 1018 for idl_type, method in idl_types_methods |
1011 if idl_type.is_wrapper_type): | 1019 if idl_type.is_wrapper_type): |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 | 1335 |
1328 idl_type = deleter.idl_type | 1336 idl_type = deleter.idl_type |
1329 extended_attributes = deleter.extended_attributes | 1337 extended_attributes = deleter.extended_attributes |
1330 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete
r, 'CallWith', 'ScriptState') | 1338 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete
r, 'CallWith', 'ScriptState') |
1331 return { | 1339 return { |
1332 'is_call_with_script_state': is_call_with_script_state, | 1340 'is_call_with_script_state': is_call_with_script_state, |
1333 'is_custom': 'Custom' in extended_attributes, | 1341 'is_custom': 'Custom' in extended_attributes, |
1334 'is_raises_exception': 'RaisesException' in extended_attributes, | 1342 'is_raises_exception': 'RaisesException' in extended_attributes, |
1335 'name': cpp_name(deleter), | 1343 'name': cpp_name(deleter), |
1336 } | 1344 } |
OLD | NEW |