OLD | NEW |
---|---|
1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 | 108 |
109 | 109 |
110 def scoped_name(interface, definition, base_name): | 110 def scoped_name(interface, definition, base_name): |
111 # partial interfaces are implemented as separate classes, with their members | 111 # partial interfaces are implemented as separate classes, with their members |
112 # implemented as static member functions | 112 # implemented as static member functions |
113 partial_interface_implemented_as = definition.extended_attributes.get('Parti alInterfaceImplementedAs') | 113 partial_interface_implemented_as = definition.extended_attributes.get('Parti alInterfaceImplementedAs') |
114 if partial_interface_implemented_as: | 114 if partial_interface_implemented_as: |
115 return '%s::%s' % (partial_interface_implemented_as, base_name) | 115 return '%s::%s' % (partial_interface_implemented_as, base_name) |
116 if definition.is_static: | 116 if definition.is_static: |
117 return '%s::%s' % (cpp_name(interface), base_name) | 117 return '%s::%s' % (cpp_name(interface), base_name) |
118 if definition.name in ('Constructor', 'NamedConstructor'): | |
Nils Barth (inactive)
2014/04/09 09:36:38
How about joining with previous condition, as you'
sof
2014/04/09 10:53:16
Done.
| |
119 return '%s::%s' % (cpp_name(interface), base_name) | |
118 return 'impl->%s' % base_name | 120 return 'impl->%s' % base_name |
119 | 121 |
120 | 122 |
121 def v8_class_name(interface): | 123 def v8_class_name(interface): |
122 return v8_types.v8_type(interface.name) | 124 return v8_types.v8_type(interface.name) |
123 | 125 |
124 | 126 |
125 ################################################################################ | 127 ################################################################################ |
126 # Specific extended attributes | 128 # Specific extended attributes |
127 ################################################################################ | 129 ################################################################################ |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 | 235 |
234 The returned function checks if a method/attribute is enabled. | 236 The returned function checks if a method/attribute is enabled. |
235 Given extended attribute RuntimeEnabled=FeatureName, return: | 237 Given extended attribute RuntimeEnabled=FeatureName, return: |
236 RuntimeEnabledFeatures::{featureName}Enabled | 238 RuntimeEnabledFeatures::{featureName}Enabled |
237 """ | 239 """ |
238 extended_attributes = definition_or_member.extended_attributes | 240 extended_attributes = definition_or_member.extended_attributes |
239 if 'RuntimeEnabled' not in extended_attributes: | 241 if 'RuntimeEnabled' not in extended_attributes: |
240 return None | 242 return None |
241 feature_name = extended_attributes['RuntimeEnabled'] | 243 feature_name = extended_attributes['RuntimeEnabled'] |
242 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) | 244 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) |
OLD | NEW |