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

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

Issue 16638013: Adding annotations for native types of type Object or dynamic. (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 | « tools/dom/scripts/dartmetadata.py ('k') | tools/dom/scripts/htmlrenamer.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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 451
452 This conversion assumes the success callback is always provided before the 452 This conversion assumes the success callback is always provided before the
453 error callback (and so far in the DOM API, this is the case).""" 453 error callback (and so far in the DOM API, this is the case)."""
454 callback_info = GetCallbackInfo( 454 callback_info = GetCallbackInfo(
455 self._database.GetInterface(info.callback_args[0].type_id)) 455 self._database.GetInterface(info.callback_args[0].type_id))
456 456
457 param_list = info.ParametersAsArgumentList() 457 param_list = info.ParametersAsArgumentList()
458 metadata = '' 458 metadata = ''
459 if '_RenamingAnnotation' in dir(self): 459 if '_RenamingAnnotation' in dir(self):
460 metadata = (self._RenamingAnnotation(info.declared_name, html_name) + 460 metadata = (self._RenamingAnnotation(info.declared_name, html_name) +
461 self._Metadata(info.type_name, info.declared_name)) 461 self._Metadata(info.type_name, info.declared_name, None))
462 self._members_emitter.Emit( 462 self._members_emitter.Emit(
463 '\n' 463 '\n'
464 ' $METADATA$MODIFIERS$TYPE$FUTURE_GENERIC $NAME($PARAMS) {\n' 464 ' $METADATA$MODIFIERS$TYPE$FUTURE_GENERIC $NAME($PARAMS) {\n'
465 ' var completer = new Completer$(FUTURE_GENERIC)();\n' 465 ' var completer = new Completer$(FUTURE_GENERIC)();\n'
466 ' $ORIGINAL_FUNCTION($PARAMS_LIST\n' 466 ' $ORIGINAL_FUNCTION($PARAMS_LIST\n'
467 ' $NAMED_PARAM($VARIABLE_NAME) { ' 467 ' $NAMED_PARAM($VARIABLE_NAME) { '
468 'completer.complete($VARIABLE_NAME); }' 468 'completer.complete($VARIABLE_NAME); }'
469 '$ERROR_CALLBACK);\n' 469 '$ERROR_CALLBACK);\n'
470 ' return completer.future;\n' 470 ' return completer.future;\n'
471 ' }\n', 471 ' }\n',
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 if interface.parents: 585 if interface.parents:
586 parent = interface.parents[0] 586 parent = interface.parents[0]
587 if IsPureInterface(parent.type.id): 587 if IsPureInterface(parent.type.id):
588 walk(interface.parents) 588 walk(interface.parents)
589 else: 589 else:
590 walk(interface.parents[1:]) 590 walk(interface.parents[1:])
591 return result 591 return result
592 592
593 def _DartType(self, type_name): 593 def _DartType(self, type_name):
594 return self._type_registry.DartType(type_name) 594 return self._type_registry.DartType(type_name)
OLDNEW
« no previous file with comments | « tools/dom/scripts/dartmetadata.py ('k') | tools/dom/scripts/htmlrenamer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698