Index: tools/dom/scripts/idlnode.py |
diff --git a/tools/dom/scripts/idlnode.py b/tools/dom/scripts/idlnode.py |
index 9957b359c198e98c6a25c3ed5b7e5bc321dbe3cd..8684071c1dfd8f1e1eab54cfeda6f531da70823a 100755 |
--- a/tools/dom/scripts/idlnode.py |
+++ b/tools/dom/scripts/idlnode.py |
@@ -7,6 +7,12 @@ import os |
import sys |
+_operation_suffix_map = { |
+ '__getter__': "Getter", |
+ '__setter__': "Setter", |
+ '__delete__': "Deleter", |
+} |
+ |
class IDLNode(object): |
"""Base class for all IDL elements. |
IDLNode may contain various child nodes, and have properties. Examples |
@@ -493,6 +499,11 @@ class IDLOperation(IDLMember): |
else: |
raise Exception('Cannot handle %s: operation has no id' % ast) |
+ if len(self.arguments) >= 1 and (self.id in _operation_suffix_map) and not self.ext_attrs.get('ImplementedAs'): |
+ arg = self.arguments[0] |
+ operation_category = 'Named' if arg.type.id == 'DOMString' else 'Indexed' |
+ self.ext_attrs.setdefault('ImplementedAs', 'anonymous%s%s' % (operation_category, _operation_suffix_map[self.id])) |
+ |
def _extra_repr(self): |
return [self.arguments] |