Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: Source/bindings/scripts/v8_interface.py

Issue 862403002: IDL: Support [TypeChecking=Interface] correctly on indexed setters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 1177
1178 def property_setter(interface, setter): 1178 def property_setter(interface, setter):
1179 idl_type = setter.arguments[1].idl_type 1179 idl_type = setter.arguments[1].idl_type
1180 extended_attributes = setter.extended_attributes 1180 extended_attributes = setter.extended_attributes
1181 is_raises_exception = 'RaisesException' in extended_attributes 1181 is_raises_exception = 'RaisesException' in extended_attributes
1182 restricted_float = ( 1182 restricted_float = (
1183 has_extended_attribute_value(interface, 'TypeChecking', 'Unrestricted') or 1183 has_extended_attribute_value(interface, 'TypeChecking', 'Unrestricted') or
1184 has_extended_attribute_value(setter, 'TypeChecking', 'Unrestricted')) 1184 has_extended_attribute_value(setter, 'TypeChecking', 'Unrestricted'))
1185 return { 1185 return {
1186 'has_type_checking_interface': 1186 'has_type_checking_interface':
1187 # FIXME: check interface's [TypeChecking] attribute too. 1187 (has_extended_attribute_value(interface, 'TypeChecking', 'Interface' ) or
1188 has_extended_attribute_value(setter, 'TypeChecking', 'Interface') an d 1188 has_extended_attribute_value(setter, 'TypeChecking', 'Interface')) and
1189 idl_type.is_wrapper_type, 1189 idl_type.is_wrapper_type,
1190 'idl_type': idl_type.base_type, 1190 'idl_type': idl_type.base_type,
1191 'is_custom': 'Custom' in extended_attributes, 1191 'is_custom': 'Custom' in extended_attributes,
1192 'has_exception_state': (is_raises_exception or 1192 'has_exception_state': (is_raises_exception or
1193 idl_type.v8_conversion_needs_exception_state), 1193 idl_type.v8_conversion_needs_exception_state),
1194 'is_raises_exception': is_raises_exception, 1194 'is_raises_exception': is_raises_exception,
1195 'name': cpp_name(setter), 1195 'name': cpp_name(setter),
1196 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value( 1196 'v8_value_to_local_cpp_value': idl_type.v8_value_to_local_cpp_value(
1197 extended_attributes, 'v8Value', 'propertyValue', restricted_float), 1197 extended_attributes, 'v8Value', 'propertyValue', restricted_float),
1198 } 1198 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 deleter = next( 1310 deleter = next(
1311 method 1311 method
1312 for method in interface.operations 1312 for method in interface.operations
1313 if ('deleter' in method.specials and 1313 if ('deleter' in method.specials and
1314 len(method.arguments) == 1 and 1314 len(method.arguments) == 1 and
1315 str(method.arguments[0].idl_type) == 'DOMString')) 1315 str(method.arguments[0].idl_type) == 'DOMString'))
1316 except StopIteration: 1316 except StopIteration:
1317 return None 1317 return None
1318 1318
1319 return property_deleter(deleter) 1319 return property_deleter(deleter)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698