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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 continue | 99 continue |
100 extended_attribute = attribute_name | 100 extended_attribute = attribute_name |
101 if attribute_value != 'VALUE_IS_MISSING': | 101 if attribute_value != 'VALUE_IS_MISSING': |
102 extended_attribute += '=' + attribute_value | 102 extended_attribute += '=' + attribute_value |
103 extended_attributes_list.append(extended_attribute) | 103 extended_attributes_list.append(extended_attribute) |
104 if extended_attributes_list: | 104 if extended_attributes_list: |
105 extended_string = '[%s] ' % ', '.join(extended_attributes_list) | 105 extended_string = '[%s] ' % ', '.join(extended_attributes_list) |
106 else: | 106 else: |
107 extended_string = '' | 107 extended_string = '' |
108 | 108 |
109 # FIXME: Remove this once we remove [InterfaceName] IDL attribute, http://cr
bug.com/242137 | 109 attribute_string = 'attribute %(interface_name)sConstructor %(interface_name
)s' % {'interface_name': interface_name} |
110 if 'InterfaceName' in extended_attributes: | |
111 extended_interface_name = extended_attributes['InterfaceName'] | |
112 else: | |
113 extended_interface_name = interface_name | |
114 attribute_string = 'attribute %sConstructor %s' % (interface_name, extended_
interface_name) | |
115 attributes_list = [extended_string + attribute_string] | 110 attributes_list = [extended_string + attribute_string] |
116 | 111 |
117 # In addition to the regular property, for every [NamedConstructor] | 112 # In addition to the regular property, for every [NamedConstructor] |
118 # extended attribute on an interface, a corresponding property MUST exist | 113 # extended attribute on an interface, a corresponding property MUST exist |
119 # on the ECMAScript global object. | 114 # on the ECMAScript global object. |
120 if 'NamedConstructor' in extended_attributes: | 115 if 'NamedConstructor' in extended_attributes: |
121 named_constructor = extended_attributes['NamedConstructor'] | 116 named_constructor = extended_attributes['NamedConstructor'] |
122 # Extract function name, namely everything before opening '(' | 117 # Extract function name, namely everything before opening '(' |
123 constructor_name = re.sub(r'\(.*', '', named_constructor) | 118 constructor_name = re.sub(r'\(.*', '', named_constructor) |
124 # Note the reduplicated 'ConstructorConstructor' | 119 # Note the reduplicated 'ConstructorConstructor' |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 idl_files = [] | 213 idl_files = [] |
219 with open(options.idl_files_list) as idl_files_list_file: | 214 with open(options.idl_files_list) as idl_files_list_file: |
220 for line in idl_files_list_file: | 215 for line in idl_files_list_file: |
221 idl_files.append(string.rstrip(line, '\n')) | 216 idl_files.append(string.rstrip(line, '\n')) |
222 resolved_supplementals = parse_idl_files(idl_files, options.window_construct
ors_file, options.workercontext_constructors_file) | 217 resolved_supplementals = parse_idl_files(idl_files, options.window_construct
ors_file, options.workercontext_constructors_file) |
223 write_dependency_file(options.supplemental_dependency_file, resolved_supplem
entals, only_if_changed=options.write_file_only_if_changed) | 218 write_dependency_file(options.supplemental_dependency_file, resolved_supplem
entals, only_if_changed=options.write_file_only_if_changed) |
224 | 219 |
225 | 220 |
226 if __name__ == '__main__': | 221 if __name__ == '__main__': |
227 main() | 222 main() |
OLD | NEW |