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 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 if not getter: | 1222 if not getter: |
1223 return None | 1223 return None |
1224 | 1224 |
1225 def is_null_expression(idl_type): | 1225 def is_null_expression(idl_type): |
1226 if idl_type.use_output_parameter_for_result: | 1226 if idl_type.use_output_parameter_for_result: |
1227 return 'result.isNull()' | 1227 return 'result.isNull()' |
1228 if idl_type.is_string_type: | 1228 if idl_type.is_string_type: |
1229 return 'result.isNull()' | 1229 return 'result.isNull()' |
1230 if idl_type.is_interface_type: | 1230 if idl_type.is_interface_type: |
1231 return '!result' | 1231 return '!result' |
| 1232 if idl_type.base_type in ('any', 'object'): |
| 1233 return 'result.isEmpty()' |
1232 return '' | 1234 return '' |
1233 | 1235 |
1234 idl_type = getter.idl_type | 1236 idl_type = getter.idl_type |
1235 extended_attributes = getter.extended_attributes | 1237 extended_attributes = getter.extended_attributes |
1236 is_raises_exception = 'RaisesException' in extended_attributes | 1238 is_raises_exception = 'RaisesException' in extended_attributes |
1237 use_output_parameter_for_result = idl_type.use_output_parameter_for_result | 1239 use_output_parameter_for_result = idl_type.use_output_parameter_for_result |
1238 | 1240 |
1239 # FIXME: make more generic, so can use v8_methods.cpp_value | 1241 # FIXME: make more generic, so can use v8_methods.cpp_value |
1240 cpp_method_name = 'impl->%s' % cpp_name(getter) | 1242 cpp_method_name = 'impl->%s' % cpp_name(getter) |
1241 | 1243 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 if not deleter: | 1298 if not deleter: |
1297 return None | 1299 return None |
1298 | 1300 |
1299 idl_type = deleter.idl_type | 1301 idl_type = deleter.idl_type |
1300 extended_attributes = deleter.extended_attributes | 1302 extended_attributes = deleter.extended_attributes |
1301 return { | 1303 return { |
1302 'is_custom': 'Custom' in extended_attributes, | 1304 'is_custom': 'Custom' in extended_attributes, |
1303 'is_raises_exception': 'RaisesException' in extended_attributes, | 1305 'is_raises_exception': 'RaisesException' in extended_attributes, |
1304 'name': cpp_name(deleter), | 1306 'name': cpp_name(deleter), |
1305 } | 1307 } |
OLD | NEW |