Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: tools/dom/scripts/idlnode.py

Issue 1720743005: Generation of sdk/lib files from 45 roll (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged with TOT Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/scripts/idlnode.py
diff --git a/tools/dom/scripts/idlnode.py b/tools/dom/scripts/idlnode.py
index 8dfd3b80c017a925d625188990d2e76ab0df5d2c..b5949a32379a182fae578a643c7bec73de1e0c4e 100755
--- a/tools/dom/scripts/idlnode.py
+++ b/tools/dom/scripts/idlnode.py
@@ -573,15 +573,25 @@ class IDLType(IDLNode):
elif ast.__module__ == "idl_types":
if isinstance(ast, IdlType) or isinstance(ast, IdlArrayOrSequenceType) or \
isinstance(ast, IdlNullableType):
- type_name = str(ast)
- # TODO(terry): For now don't handle unrestricted types see
- # https://code.google.com/p/chromium/issues/detail?id=354298
- type_name = type_name.replace('unrestricted ', '', 1);
+ if isinstance(ast, IdlNullableType) and ast.inner_type.is_union_type:
+ print 'WARNING type %s is union mapped to \'any\'' % self.id
+ # TODO(terry): For union types use any otherwise type is unionType is
+ # not found and is removed during merging.
+ self.id = 'any'
+ else:
+ type_name = str(ast)
+ # TODO(terry): For now don't handle unrestricted types see
+ # https://code.google.com/p/chromium/issues/detail?id=354298
+ type_name = type_name.replace('unrestricted ', '', 1);
+
+ # TODO(terry): Handled USVString as a DOMString.
+ type_name = type_name.replace('USVString', 'DOMString', 1)
- # TODO(terry): Handled USVString as a DOMString.
- type_name = type_name.replace('USVString', 'DOMString', 1)
+ # TODO(terry); WindowTimers setInterval/setTimeout overloads with a
+ # Function type - map to any until the IDL uses union.
+ type_name = type_name.replace('Function', 'any', 1)
- self.id = type_name
+ self.id = type_name
else:
# IdlUnionType
if ast.is_union_type:
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698