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

Side by Side Diff: tools/dom/scripts/htmldartgenerator.py

Issue 11719003: Nuke custom factory providers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebaselining Created 7 years, 11 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 | « sdk/lib/web_audio/dart2js/web_audio_dart2js.dart ('k') | tools/dom/scripts/systemhtml.py » ('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 the system to generate 6 """This module provides shared functionality for the system to generate
7 dart:html APIs from the IDL database.""" 7 dart:html APIs from the IDL database."""
8 8
9 from generator import AnalyzeOperation, ConstantOutputOrder, \ 9 from generator import AnalyzeOperation, ConstantOutputOrder, \
10 DartDomNameOfAttribute, FindMatchingAttribute, IsDartCollectionType, \ 10 DartDomNameOfAttribute, FindMatchingAttribute, IsDartCollectionType, \
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 FACTORY=factory_name, 320 FACTORY=factory_name,
321 CTOR_FACTORY_NAME=factory_constructor_name, 321 CTOR_FACTORY_NAME=factory_constructor_name,
322 PARAMS=constructor_info.ParametersDeclaration(self._DartType), 322 PARAMS=constructor_info.ParametersDeclaration(self._DartType),
323 FACTORY_PARAMS=factory_parameters) 323 FACTORY_PARAMS=factory_parameters)
324 324
325 for index, param_info in enumerate(constructor_info.param_infos): 325 for index, param_info in enumerate(constructor_info.param_infos):
326 if param_info.is_optional: 326 if param_info.is_optional:
327 inits.Emit(' if ($E != null) e.$E = $E;\n', E=param_info.name) 327 inits.Emit(' if ($E != null) e.$E = $E;\n', E=param_info.name)
328 328
329 if not constructor_info.pure_dart_constructor: 329 if not constructor_info.pure_dart_constructor:
330 template_file = ('factoryprovider_%s.darttemplate' % self._interface.doc_j s_name) 330 self.EmitStaticFactory(constructor_info)
331 template = self._template_loader.TryLoad(template_file)
332 if template:
333 # There is a class specific factory.
334 # TODO(antonm): should move into the class template.
335 self._members_emitter.Emit(template)
336 else:
337 self.EmitStaticFactory(constructor_info)
338 331
339 def EmitHelpers(self, base_class): 332 def EmitHelpers(self, base_class):
340 pass 333 pass
341 334
342 def DeclareAttribute(self, attribute, type_name, attr_name, read_only): 335 def DeclareAttribute(self, attribute, type_name, attr_name, read_only):
343 """ Declares an attribute but does not include the code to invoke it. 336 """ Declares an attribute but does not include the code to invoke it.
344 """ 337 """
345 self.EmitAttributeDocumentation(attribute) 338 self.EmitAttributeDocumentation(attribute)
346 if read_only: 339 if read_only:
347 template = '\n $TYPE get $NAME;\n' 340 template = '\n $TYPE get $NAME;\n'
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 walk(interface.parents) 432 walk(interface.parents)
440 else: 433 else:
441 walk(interface.parents[1:]) 434 walk(interface.parents[1:])
442 return result 435 return result
443 436
444 def _DartType(self, type_name): 437 def _DartType(self, type_name):
445 return self._type_registry.DartType(type_name) 438 return self._type_registry.DartType(type_name)
446 439
447 def _IsPrivate(self, name): 440 def _IsPrivate(self, name):
448 return name.startswith('_') 441 return name.startswith('_')
OLDNEW
« no previous file with comments | « sdk/lib/web_audio/dart2js/web_audio_dart2js.dart ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698