| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 'any_type_attributes': any_type_attributes, | 220 'any_type_attributes': any_type_attributes, |
| 221 'constructors': constructors, | 221 'constructors': constructors, |
| 222 'has_custom_constructor': bool(custom_constructors), | 222 'has_custom_constructor': bool(custom_constructors), |
| 223 'has_event_constructor': has_event_constructor, | 223 'has_event_constructor': has_event_constructor, |
| 224 'interface_length': | 224 'interface_length': |
| 225 interface_length(interface, constructors + custom_constructors), | 225 interface_length(interface, constructors + custom_constructors), |
| 226 'is_constructor_raises_exception': extended_attributes.get('RaisesExcept
ion') == 'Constructor', # [RaisesException=Constructor] | 226 'is_constructor_raises_exception': extended_attributes.get('RaisesExcept
ion') == 'Constructor', # [RaisesException=Constructor] |
| 227 'named_constructor': named_constructor, | 227 'named_constructor': named_constructor, |
| 228 }) | 228 }) |
| 229 | 229 |
| 230 constants = [constant_context(constant) for constant in interface.constants] |
| 231 |
| 230 # Constants | 232 # Constants |
| 231 context.update({ | 233 context.update({ |
| 232 'constants': [constant_context(constant) | 234 'constants': constants, |
| 233 for constant in interface.constants], | |
| 234 'do_not_check_constants': 'DoNotCheckConstants' in extended_attributes, | 235 'do_not_check_constants': 'DoNotCheckConstants' in extended_attributes, |
| 236 'has_constant_configuration': any( |
| 237 not constant['runtime_enabled_function'] |
| 238 for constant in constants), |
| 235 }) | 239 }) |
| 236 | 240 |
| 237 # Attributes | 241 # Attributes |
| 238 attributes = [v8_attributes.attribute_context(interface, attribute) | 242 attributes = [v8_attributes.attribute_context(interface, attribute) |
| 239 for attribute in interface.attributes] | 243 for attribute in interface.attributes] |
| 240 context.update({ | 244 context.update({ |
| 241 'attributes': attributes, | 245 'attributes': attributes, |
| 242 'has_accessors': any(attribute['is_expose_js_accessors'] and attribute['
should_be_exposed_to_script'] for attribute in attributes), | 246 'has_accessors': any(attribute['is_expose_js_accessors'] and attribute['
should_be_exposed_to_script'] for attribute in attributes), |
| 243 'has_attribute_configuration': any( | 247 'has_attribute_configuration': any( |
| 244 not (attribute['is_expose_js_accessors'] or | 248 not (attribute['is_expose_js_accessors'] or |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 deleter = next( | 1120 deleter = next( |
| 1117 method | 1121 method |
| 1118 for method in interface.operations | 1122 for method in interface.operations |
| 1119 if ('deleter' in method.specials and | 1123 if ('deleter' in method.specials and |
| 1120 len(method.arguments) == 1 and | 1124 len(method.arguments) == 1 and |
| 1121 str(method.arguments[0].idl_type) == 'DOMString')) | 1125 str(method.arguments[0].idl_type) == 'DOMString')) |
| 1122 except StopIteration: | 1126 except StopIteration: |
| 1123 return None | 1127 return None |
| 1124 | 1128 |
| 1125 return property_deleter(deleter) | 1129 return property_deleter(deleter) |
| OLD | NEW |