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

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

Issue 2948493002: Typedefs and IDL file order between platforms could generated different files. (Closed)
Patch Set: typedefs and IDL xfile ordering between platforms could generated different files Created 3 years, 6 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/generator.py ('k') | no next file » | 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
old mode 100755
new mode 100644
index b88db3ae497ba2e440021e1621b8bd472450c797..85d711c06807cf615dbc205b0bb842cb18902701
--- a/tools/dom/scripts/idlnode.py
+++ b/tools/dom/scripts/idlnode.py
@@ -384,6 +384,16 @@ class IDLFile(IDLNode):
# Report of union types mapped to any.
+ # Remember all the typedefs before we start walking the AST. Some
+ # IDLs now have typedefs before interfaces. So we need to remember
+ # to resolve the typedefs.
+ self.typeDefs = self._convert_all(ast, 'TypeDef', IDLTypeDef)
+ for typedefName in ast.typedefs:
+ typedef_type = ast.typedefs[typedefName]
+ # Ignore unions and dictionaries for now we just want normal typedefs to resolve our arguments/types.
+ if not(isinstance(typedef_type.idl_type, IdlUnionType)) and not(typedef_type.idl_type.base_type == 'Dictionary'):
+ _addTypedef(IDLTypeDef(typedef_type))
+
self.interfaces = self._convert_all(ast, 'Interface', IDLInterface)
self.dictionaries = self._convert_all(ast, 'Dictionary', IDLDictionary)
@@ -432,10 +442,7 @@ class IDLFile(IDLNode):
self.implementsStatements = self._convert_all(ast, 'ImplStmt',
IDLImplementsStatement)
- # No reason to handle typedef they're already aliased in Blink's AST.
- self.typeDefs = [] if is_blink else self._convert_all(ast, 'TypeDef', IDLTypeDef)
-
- # Hack to record typedefs that are unions.
+ # Record typedefs that are unions.
for typedefName in ast.typedefs:
typedef_type = ast.typedefs[typedefName]
if isinstance(typedef_type.idl_type, IdlUnionType):
@@ -443,9 +450,6 @@ class IDLFile(IDLNode):
elif typedef_type.idl_type.base_type == 'Dictionary':
dictionary = IDLDictionary(typedef_type, True)
self.dictionaries.append(dictionary)
- else:
- # All other typedefs we record
- _addTypedef(IDLTypeDef(typedef_type))
self.enums = self._convert_all(ast, 'Enum', IDLEnum)
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698