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

Unified Diff: lib/dom/scripts/generator.py

Issue 10584031: Proper support for IDL arrays in generators. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « lib/dom/scripts/dartgenerator.py ('k') | lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/generator.py
diff --git a/lib/dom/scripts/generator.py b/lib/dom/scripts/generator.py
index 886d8e02034d4e75e4d0d24ac766f930662415fd..62d4bfb7a9c4b1e5e209deb7a7bb14dcc47e11e1 100644
--- a/lib/dom/scripts/generator.py
+++ b/lib/dom/scripts/generator.py
@@ -732,7 +732,6 @@ _idl_type_registry = {
'double': PrimitiveIDLTypeInfo('double', dart_type='num'),
'any': PrimitiveIDLTypeInfo('any', dart_type='Object'),
- 'any[]': PrimitiveIDLTypeInfo('any[]', dart_type='List'),
'Array': PrimitiveIDLTypeInfo('Array', dart_type='List'),
'custom': PrimitiveIDLTypeInfo('custom', dart_type='Dynamic'),
'Date': PrimitiveIDLTypeInfo('Date', dart_type='Date', native_type='double'),
@@ -760,6 +759,7 @@ _idl_type_registry = {
'CSSRule': IDLTypeInfo('CSSRule', conversion_includes=['CSSImportRule']),
'DOMException': IDLTypeInfo('DOMException', native_type='DOMCoreException'),
+ 'DOMString[]': IDLTypeInfo('DOMStringList', dart_type='List<String>', custom_to_native=True),
podivilov 2012/06/20 15:08:39 Is there any difference between DOMString[] and DO
Anton Muhin 2012/06/20 15:13:54 For now I just followed v8 bindings which apparent
podivilov 2012/06/20 15:54:46 If they are the same things, we should just fix th
sra1 2012/06/20 16:33:26 I think that they are not the same. On Chrome the
Anton Muhin 2012/06/20 18:45:47 Sorry, I indeed missed that they create a fresh ar
'DOMStringList': IDLTypeInfo('DOMStringList', dart_type='List<String>', custom_to_native=True),
'DOMStringMap': IDLTypeInfo('DOMStringMap', dart_type='Map<String, String>'),
'DOMWindow': IDLTypeInfo('DOMWindow', custom_to_dart=True),
@@ -798,7 +798,16 @@ _svg_supplemental_includes = [
]
def GetIDLTypeInfo(idl_type_name):
+ type_info = _idl_type_registry.get(idl_type_name)
+ if type_info is not None:
+ return type_info
+
match = re.match(r'sequence<(\w+)>$', idl_type_name)
if match:
return SequenceIDLTypeInfo(idl_type_name, GetIDLTypeInfo(match.group(1)))
- return _idl_type_registry.get(idl_type_name, IDLTypeInfo(idl_type_name))
+
+ match = re.match(r'(\w+)\[\]$', idl_type_name)
+ if match:
+ return SequenceIDLTypeInfo(idl_type_name, GetIDLTypeInfo(match.group(1)))
+
+ return IDLTypeInfo(idl_type_name)
« no previous file with comments | « lib/dom/scripts/dartgenerator.py ('k') | lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698