| 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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 # 4. Otherwise: if V is a platform object – but not a platform array | 1049 # 4. Otherwise: if V is a platform object – but not a platform array |
| 1050 # object – and there is an entry in S that has one of the following | 1050 # object – and there is an entry in S that has one of the following |
| 1051 # types at position i of its type list, | 1051 # types at position i of its type list, |
| 1052 # • an interface type that V implements | 1052 # • an interface type that V implements |
| 1053 # (Unlike most of these tests, this can return multiple methods, since we | 1053 # (Unlike most of these tests, this can return multiple methods, since we |
| 1054 # test if it implements an interface. Thus we need a for loop, not a next.) | 1054 # test if it implements an interface. Thus we need a for loop, not a next.) |
| 1055 # (We distinguish wrapper types from built-in interface types.) | 1055 # (We distinguish wrapper types from built-in interface types.) |
| 1056 for idl_type, method in ((idl_type, method) | 1056 for idl_type, method in ((idl_type, method) |
| 1057 for idl_type, method in idl_types_methods | 1057 for idl_type, method in idl_types_methods |
| 1058 if idl_type.is_wrapper_type): | 1058 if idl_type.is_wrapper_type): |
| 1059 test = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate())'.forma
t(idl_type=idl_type.base_type, cpp_value=cpp_value) | 1059 if idl_type.is_array_buffer_or_view: |
| 1060 test = '{cpp_value}->Is{idl_type}()'.format(idl_type=idl_type.base_t
ype, cpp_value=cpp_value) |
| 1061 else: |
| 1062 test = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate())'.f
ormat(idl_type=idl_type.base_type, cpp_value=cpp_value) |
| 1060 yield test, method | 1063 yield test, method |
| 1061 | 1064 |
| 1062 # 13. Otherwise: if IsCallable(V) is true, and there is an entry in S that | 1065 # 13. Otherwise: if IsCallable(V) is true, and there is an entry in S that |
| 1063 # has one of the following types at position i of its type list, | 1066 # has one of the following types at position i of its type list, |
| 1064 # • a callback function type | 1067 # • a callback function type |
| 1065 # ... | 1068 # ... |
| 1066 # | 1069 # |
| 1067 # FIXME: | 1070 # FIXME: |
| 1068 # We test for functions rather than callability, which isn't strictly the | 1071 # We test for functions rather than callability, which isn't strictly the |
| 1069 # same thing. | 1072 # same thing. |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1378 | 1381 |
| 1379 extended_attributes = deleter.extended_attributes | 1382 extended_attributes = deleter.extended_attributes |
| 1380 idl_type = deleter.idl_type | 1383 idl_type = deleter.idl_type |
| 1381 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete
r, 'CallWith', 'ScriptState') | 1384 is_call_with_script_state = v8_utilities.has_extended_attribute_value(delete
r, 'CallWith', 'ScriptState') |
| 1382 return { | 1385 return { |
| 1383 'is_call_with_script_state': is_call_with_script_state, | 1386 'is_call_with_script_state': is_call_with_script_state, |
| 1384 'is_custom': 'Custom' in extended_attributes, | 1387 'is_custom': 'Custom' in extended_attributes, |
| 1385 'is_raises_exception': 'RaisesException' in extended_attributes, | 1388 'is_raises_exception': 'RaisesException' in extended_attributes, |
| 1386 'name': cpp_name(deleter), | 1389 'name': cpp_name(deleter), |
| 1387 } | 1390 } |
| OLD | NEW |