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

Side by Side Diff: lib/html/scripts/systemdart2js.py

Issue 10941047: Don't generate FooList if it behaves like List<Foo> exactly. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
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 the systems to generate 6 """This module provides shared functionality for the systems to generate
7 dart2js binding from the IDL database.""" 7 dart2js binding from the IDL database."""
8 8
9 import os 9 import os
10 from generator import * 10 from generator import *
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 constructor_info = AnalyzeConstructor(interface) 127 constructor_info = AnalyzeConstructor(interface)
128 if constructor_info: 128 if constructor_info:
129 self._EmitFactoryProvider(interface_name, constructor_info) 129 self._EmitFactoryProvider(interface_name, constructor_info)
130 130
131 131
132 def FinishInterface(self): 132 def FinishInterface(self):
133 """.""" 133 """."""
134 pass 134 pass
135 135
136 def _ImplClassName(self, type_name): 136 def _ImplClassName(self, type_name):
137 name = type_name
138 if type_name in nativified_classes:
139 name = nativified_classes[type_name]
137 return '_' + type_name + 'Js' 140 return '_' + type_name + 'Js'
138 141
139 def _EmitFactoryProvider(self, interface_name, constructor_info): 142 def _EmitFactoryProvider(self, interface_name, constructor_info):
140 template_file = 'factoryprovider_%s.darttemplate' % interface_name 143 template_file = 'factoryprovider_%s.darttemplate' % interface_name
141 template = self._system._templates.TryLoad(template_file) 144 template = self._system._templates.TryLoad(template_file)
142 if not template: 145 if not template:
143 template = self._system._templates.Load('factoryprovider.darttemplate') 146 template = self._system._templates.Load('factoryprovider.darttemplate')
144 147
145 factory_provider = '_' + interface_name + 'FactoryProvider' 148 factory_provider = '_' + interface_name + 'FactoryProvider'
146 emitter = self._system._ImplFileEmitter(factory_provider) 149 emitter = self._system._ImplFileEmitter(factory_provider)
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 if info.declared_name != info.name: 380 if info.declared_name != info.name:
378 native_string = " '%s'" % info.declared_name 381 native_string = " '%s'" % info.declared_name
379 382
380 self._members_emitter.Emit( 383 self._members_emitter.Emit(
381 '\n' 384 '\n'
382 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n', 385 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n',
383 TYPE=self._NarrowOutputType(info.type_name), 386 TYPE=self._NarrowOutputType(info.type_name),
384 NAME=info.name, 387 NAME=info.name,
385 PARAMS=params, 388 PARAMS=params,
386 NATIVESTRING=native_string) 389 NATIVESTRING=native_string)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698