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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 if self.stringifier.attribute: | 380 if self.stringifier.attribute: |
381 self.attributes.append(self.stringifier.attribute) | 381 self.attributes.append(self.stringifier.attribute) |
382 elif self.stringifier.operation: | 382 elif self.stringifier.operation: |
383 self.operations.append(self.stringifier.operation) | 383 self.operations.append(self.stringifier.operation) |
384 | 384 |
385 def merge(self, other): | 385 def merge(self, other): |
386 """Merge in another interface's members (e.g., partial interface)""" | 386 """Merge in another interface's members (e.g., partial interface)""" |
387 self.attributes.extend(other.attributes) | 387 self.attributes.extend(other.attributes) |
388 self.constants.extend(other.constants) | 388 self.constants.extend(other.constants) |
389 self.operations.extend(other.operations) | 389 self.operations.extend(other.operations) |
| 390 if self.serializer is None: |
| 391 self.serializer = other.serializer |
| 392 if self.stringifier is None: |
| 393 self.stringifier = other.stringifier |
390 | 394 |
391 | 395 |
392 class IdlException(IdlInterface): | 396 class IdlException(IdlInterface): |
393 # Properly exceptions and interfaces are distinct, and thus should inherit a | 397 # Properly exceptions and interfaces are distinct, and thus should inherit a |
394 # common base class (say, "IdlExceptionOrInterface"). | 398 # common base class (say, "IdlExceptionOrInterface"). |
395 # However, there is only one exception (DOMException), and new exceptions | 399 # However, there is only one exception (DOMException), and new exceptions |
396 # are not expected. Thus it is easier to implement exceptions as a | 400 # are not expected. Thus it is easier to implement exceptions as a |
397 # restricted subclass of interfaces. | 401 # restricted subclass of interfaces. |
398 # http://www.w3.org/TR/WebIDL/#idl-exceptions | 402 # http://www.w3.org/TR/WebIDL/#idl-exceptions |
399 def __init__(self, idl_name, node): | 403 def __init__(self, idl_name, node): |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 self.visit_typed_object(argument) | 1111 self.visit_typed_object(argument) |
1108 | 1112 |
1109 def visit_iterable(self, iterable): | 1113 def visit_iterable(self, iterable): |
1110 self.visit_typed_object(iterable) | 1114 self.visit_typed_object(iterable) |
1111 | 1115 |
1112 def visit_maplike(self, maplike): | 1116 def visit_maplike(self, maplike): |
1113 self.visit_typed_object(maplike) | 1117 self.visit_typed_object(maplike) |
1114 | 1118 |
1115 def visit_setlike(self, setlike): | 1119 def visit_setlike(self, setlike): |
1116 self.visit_typed_object(setlike) | 1120 self.visit_typed_object(setlike) |
OLD | NEW |