Index: tools/dom/scripts/dartgenerator.py |
diff --git a/tools/dom/scripts/dartgenerator.py b/tools/dom/scripts/dartgenerator.py |
index 5adbe3a8264b713bc77d310fc399bc52dbfa62bc..e3e96257a7836ce88c7adb378bd6972bcf8fd90d 100755 |
--- a/tools/dom/scripts/dartgenerator.py |
+++ b/tools/dom/scripts/dartgenerator.py |
@@ -12,6 +12,7 @@ import os |
import re |
import shutil |
from generator import * |
+from idlnode import IDLType |
_logger = logging.getLogger('dartgenerator') |
@@ -245,10 +246,17 @@ class DartGenerator(object): |
if 'ScriptArguments' in call_with: |
operation.arguments.append(ARG) |
- # TODO(terry): Hack to remove 3rd arguments in setInterval/setTimeout. |
- def HackCleanupTimers(self, database): |
+ def CleanupOperationArguments(self, database): |
for interface in database.GetInterfaces(): |
for operation in interface.operations: |
+ # TODO(terry): Hack to remove 3rd arguments in setInterval/setTimeout. |
if ((operation.id == 'setInterval' or operation.id == 'setTimeout') and \ |
operation.arguments[0].type.id == 'any'): |
operation.arguments.pop(2) |
+ |
+ # Massage any operation argument type that is IDLEnum to String. |
+ for index, argument in enumerate(operation.arguments): |
+ type_name = argument.type.id |
+ if database.HasEnum(type_name): |
+ operation.arguments[index].type = IDLType('DOMString') |
+ |