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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 def scoped_name(interface, definition, base_name): | 119 def scoped_name(interface, definition, base_name): |
120 # partial interfaces are implemented as separate classes, with their members | 120 # partial interfaces are implemented as separate classes, with their members |
121 # implemented as static member functions | 121 # implemented as static member functions |
122 partial_interface_implemented_as = definition.extended_attributes.get('Parti
alInterfaceImplementedAs') | 122 partial_interface_implemented_as = definition.extended_attributes.get('Parti
alInterfaceImplementedAs') |
123 if partial_interface_implemented_as: | 123 if partial_interface_implemented_as: |
124 return '%s::%s' % (partial_interface_implemented_as, base_name) | 124 return '%s::%s' % (partial_interface_implemented_as, base_name) |
125 if (definition.is_static or | 125 if (definition.is_static or |
126 definition.name in ('Constructor', 'NamedConstructor')): | 126 definition.name in ('Constructor', 'NamedConstructor')): |
127 return '%s::%s' % (cpp_name(interface), base_name) | 127 return '%s::%s' % (cpp_name(interface), base_name) |
128 if 'ImplementedInPrivateScript' in definition.extended_attributes: | 128 if 'ImplementedInPrivateScript' in definition.extended_attributes: |
129 return '%s::%s' % (v8_class_name(interface), base_name) | 129 return '%s::PrivateScript::%s' % (v8_class_name(interface), base_name) |
130 return 'impl->%s' % base_name | 130 return 'impl->%s' % base_name |
131 | 131 |
132 | 132 |
133 def v8_class_name(interface): | 133 def v8_class_name(interface): |
134 return v8_types.v8_type(interface.name) | 134 return v8_types.v8_type(interface.name) |
135 | 135 |
136 | 136 |
137 ################################################################################ | 137 ################################################################################ |
138 # Specific extended attributes | 138 # Specific extended attributes |
139 ################################################################################ | 139 ################################################################################ |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 The returned function checks if a method/attribute is enabled. | 268 The returned function checks if a method/attribute is enabled. |
269 Given extended attribute RuntimeEnabled=FeatureName, return: | 269 Given extended attribute RuntimeEnabled=FeatureName, return: |
270 RuntimeEnabledFeatures::{featureName}Enabled | 270 RuntimeEnabledFeatures::{featureName}Enabled |
271 """ | 271 """ |
272 extended_attributes = definition_or_member.extended_attributes | 272 extended_attributes = definition_or_member.extended_attributes |
273 if 'RuntimeEnabled' not in extended_attributes: | 273 if 'RuntimeEnabled' not in extended_attributes: |
274 return None | 274 return None |
275 feature_name = extended_attributes['RuntimeEnabled'] | 275 feature_name = extended_attributes['RuntimeEnabled'] |
276 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) | 276 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) |
OLD | NEW |