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

Side by Side Diff: lib/dom/scripts/generator.py

Issue 10877007: Map ObjectArray to List. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/dom/dom.dart ('k') | lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module provides shared functionality for systems to generate 6 """This module provides shared functionality for systems to generate
7 Dart APIs from the IDL database.""" 7 Dart APIs from the IDL database."""
8 8
9 import copy 9 import copy
10 import re 10 import re
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc riptValue'), 729 'DOMObject': TypeData(clazz='Primitive', dart_type='Object', native_type='Sc riptValue'),
730 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St ring'), 730 'DOMString': TypeData(clazz='Primitive', dart_type='String', native_type='St ring'),
731 # TODO(vsm): This won't actually work until we convert the Map to 731 # TODO(vsm): This won't actually work until we convert the Map to
732 # a native JS Map for JS DOM. 732 # a native JS Map for JS DOM.
733 'Dictionary': TypeData(clazz='Primitive', dart_type='Map', requires_v8_scope =True), 733 'Dictionary': TypeData(clazz='Primitive', dart_type='Map', requires_v8_scope =True),
734 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} 734 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool}
735 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa ce 735 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa ce
736 'Flags': TypeData(clazz='Primitive', dart_type='Object'), 736 'Flags': TypeData(clazz='Primitive', dart_type='Object'),
737 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un signed long long'), 737 'DOMTimeStamp': TypeData(clazz='Primitive', dart_type='int', native_type='un signed long long'),
738 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip tValue'), 738 'object': TypeData(clazz='Primitive', dart_type='Object', native_type='Scrip tValue'),
739 'ObjectArray': TypeData(clazz='Primitive', dart_type='List'),
739 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'), 740 'PositionOptions': TypeData(clazz='Primitive', dart_type='Object'),
740 # TODO(sra): Come up with some meaningful name so that where this appears in 741 # TODO(sra): Come up with some meaningful name so that where this appears in
741 # the documentation, the user is made aware that only a limited subset of 742 # the documentation, the user is made aware that only a limited subset of
742 # serializable types are actually permitted. 743 # serializable types are actually permitted.
743 'SerializedScriptValue': TypeData(clazz='Primitive', dart_type='Dynamic'), 744 'SerializedScriptValue': TypeData(clazz='Primitive', dart_type='Dynamic'),
744 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool} 745 # TODO(sra): Flags is really a dictionary: {create:bool, exclusive:bool}
745 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa ce 746 # http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interfa ce
746 'WebKitFlags': TypeData(clazz='Primitive', dart_type='Object'), 747 'WebKitFlags': TypeData(clazz='Primitive', dart_type='Object'),
747 748
748 'sequence': TypeData(clazz='Primitive', dart_type='List'), 749 'sequence': TypeData(clazz='Primitive', dart_type='List'),
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 if match: 817 if match:
817 if type_name == 'DOMString[]': 818 if type_name == 'DOMString[]':
818 return DOMStringArrayTypeInfo(TypeData('Sequence'), self.TypeInfo('DOMSt ring')) 819 return DOMStringArrayTypeInfo(TypeData('Sequence'), self.TypeInfo('DOMSt ring'))
819 item_info = self.TypeInfo(match.group(1) or match.group(2)) 820 item_info = self.TypeInfo(match.group(1) or match.group(2))
820 return SequenceIDLTypeInfo(type_name, TypeData('Sequence'), item_info) 821 return SequenceIDLTypeInfo(type_name, TypeData('Sequence'), item_info)
821 if not type_name in _idl_type_registry: 822 if not type_name in _idl_type_registry:
822 return InterfaceIDLTypeInfo(type_name, TypeData('Interface')) 823 return InterfaceIDLTypeInfo(type_name, TypeData('Interface'))
823 type_data = _idl_type_registry.get(type_name) 824 type_data = _idl_type_registry.get(type_name)
824 class_name = '%sIDLTypeInfo' % type_data.clazz 825 class_name = '%sIDLTypeInfo' % type_data.clazz
825 return globals()[class_name](type_name, type_data) 826 return globals()[class_name](type_name, type_data)
OLDNEW
« no previous file with comments | « lib/dom/dom.dart ('k') | lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698