OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 import copy | 6 import copy |
7 import database | 7 import database |
8 import idlparser | 8 import idlparser |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 source = import_options.source | 353 source = import_options.source |
354 if (source and source not in old_interface.annotations and | 354 if (source and source not in old_interface.annotations and |
355 source in new_interface.annotations and | 355 source in new_interface.annotations and |
356 not new_interface.is_supplemental): | 356 not new_interface.is_supplemental): |
357 old_interface.annotations[source] = new_interface.annotations[source] | 357 old_interface.annotations[source] = new_interface.annotations[source] |
358 changed = True | 358 changed = True |
359 | 359 |
360 def merge_list(what): | 360 def merge_list(what): |
361 old_list = old_interface.__dict__[what] | 361 old_list = old_interface.__dict__[what] |
362 new_list = new_interface.__dict__[what] | 362 new_list = new_interface.__dict__[what] |
| 363 |
| 364 if what != 'parents' and old_interface.id != new_interface.id: |
| 365 for node in new_list: |
| 366 node.ext_attrs['ImplementedBy'] = new_interface.id |
| 367 |
363 changed = self._merge_nodes(old_list, new_list, import_options) | 368 changed = self._merge_nodes(old_list, new_list, import_options) |
364 | 369 |
365 # Delete list items with zero remaining annotations. | 370 # Delete list items with zero remaining annotations. |
366 if changed and import_options.obsolete_old_declarations: | 371 if changed and import_options.obsolete_old_declarations: |
367 | 372 |
368 def has_annotations(idl_node): | 373 def has_annotations(idl_node): |
369 return len(idl_node.annotations) | 374 return len(idl_node.annotations) |
370 | 375 |
371 old_interface.__dict__[what] = filter(has_annotations, old_list) | 376 old_interface.__dict__[what] = filter(has_annotations, old_list) |
372 | 377 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 annotation = idl_node.annotations[source] | 600 annotation = idl_node.annotations[source] |
596 for name, value in annotation.items(): | 601 for name, value in annotation.items(): |
597 if (name in top_level_annotation | 602 if (name in top_level_annotation |
598 and value == top_level_annotation[name]): | 603 and value == top_level_annotation[name]): |
599 del annotation[name] | 604 del annotation[name] |
600 | 605 |
601 map(normalize, interface.parents) | 606 map(normalize, interface.parents) |
602 map(normalize, interface.constants) | 607 map(normalize, interface.constants) |
603 map(normalize, interface.attributes) | 608 map(normalize, interface.attributes) |
604 map(normalize, interface.operations) | 609 map(normalize, interface.operations) |
OLD | NEW |