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

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

Issue 17508002: Revert "Making all DOM types abstract and removing superfluous Dartium constructors." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/web_sql/dartium/web_sql_dartium.dart ('k') | tools/dom/scripts/systemnative.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 import emitter 9 import emitter
10 from generator import AnalyzeOperation, ConstantOutputOrder, \ 10 from generator import AnalyzeOperation, ConstantOutputOrder, \
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 (',\n %s(error) { completer.completeError(error); }' % 484 (',\n %s(error) { completer.completeError(error); }' %
485 ('%s : ' % info.callback_args[1].name 485 ('%s : ' % info.callback_args[1].name
486 if info.requires_named_arguments and 486 if info.requires_named_arguments and
487 info.callback_args[1].is_optional else ''))), 487 info.callback_args[1].is_optional else ''))),
488 FUTURE_GENERIC = ('' if len(callback_info.param_infos) == 0 or 488 FUTURE_GENERIC = ('' if len(callback_info.param_infos) == 0 or
489 not callback_info.param_infos[0].type_id else 489 not callback_info.param_infos[0].type_id else
490 '<%s>' % self._DartType(callback_info.param_infos[0].type_id)), 490 '<%s>' % self._DartType(callback_info.param_infos[0].type_id)),
491 ORIGINAL_FUNCTION = html_name) 491 ORIGINAL_FUNCTION = html_name)
492 492
493 def EmitHelpers(self, base_class): 493 def EmitHelpers(self, base_class):
494 if not self._members_emitter: 494 pass
495 return
496
497 self._members_emitter.Emit(
498 ' // To suppress missing implicit constructor warnings.\n'
499 ' factory $CLASSNAME._() { '
500 'throw new UnsupportedError("Not supported"); }\n',
501 CLASSNAME=self._interface_type_info.implementation_name())
502 495
503 def DeclareAttribute(self, attribute, type_name, attr_name, read_only): 496 def DeclareAttribute(self, attribute, type_name, attr_name, read_only):
504 """ Declares an attribute but does not include the code to invoke it. 497 """ Declares an attribute but does not include the code to invoke it.
505 """ 498 """
506 if read_only: 499 if read_only:
507 template = '\n $TYPE get $NAME;\n' 500 template = '\n $TYPE get $NAME;\n'
508 else: 501 else:
509 template = '\n $TYPE $NAME;\n' 502 template = '\n $TYPE $NAME;\n'
510 503
511 self._members_emitter.Emit(template, 504 self._members_emitter.Emit(template,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 if interface.parents: 585 if interface.parents:
593 parent = interface.parents[0] 586 parent = interface.parents[0]
594 if IsPureInterface(parent.type.id): 587 if IsPureInterface(parent.type.id):
595 walk(interface.parents) 588 walk(interface.parents)
596 else: 589 else:
597 walk(interface.parents[1:]) 590 walk(interface.parents[1:])
598 return result 591 return result
599 592
600 def _DartType(self, type_name): 593 def _DartType(self, type_name):
601 return self._type_registry.DartType(type_name) 594 return self._type_registry.DartType(type_name)
OLDNEW
« no previous file with comments | « sdk/lib/web_sql/dartium/web_sql_dartium.dart ('k') | tools/dom/scripts/systemnative.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698