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

Side by Side Diff: sdk/lib/html/scripts/systemhtml.py

Issue 11417060: Remive uses of "void operator[]() => ..." in the html library and enable return type checks for all… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 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 import os 10 import os
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 # class YImpl extends ListBase<T> { copies of transitive XImpl methods; } 475 # class YImpl extends ListBase<T> { copies of transitive XImpl methods; }
476 # 476 #
477 self._members_emitter.Emit( 477 self._members_emitter.Emit(
478 '\n' 478 '\n'
479 ' $TYPE operator[](int index) => JS("$TYPE", "#[#]", this, index);\n', 479 ' $TYPE operator[](int index) => JS("$TYPE", "#[#]", this, index);\n',
480 TYPE=self.SecureOutputType(element_type)) 480 TYPE=self.SecureOutputType(element_type))
481 481
482 if 'CustomIndexedSetter' in self._interface.ext_attrs: 482 if 'CustomIndexedSetter' in self._interface.ext_attrs:
483 self._members_emitter.Emit( 483 self._members_emitter.Emit(
484 '\n' 484 '\n'
485 ' void operator[]=(int index, $TYPE value) =>' 485 ' void operator[]=(int index, $TYPE value) {'
486 ' JS("void", "#[#] = #", this, index, value);\n', 486 ' JS("void", "#[#] = #", this, index, value); }',
487 TYPE=self._NarrowInputType(element_type)) 487 TYPE=self._NarrowInputType(element_type))
488 else: 488 else:
489 self._members_emitter.Emit( 489 self._members_emitter.Emit(
490 '\n' 490 '\n'
491 ' void operator[]=(int index, $TYPE value) {\n' 491 ' void operator[]=(int index, $TYPE value) {\n'
492 ' throw new UnsupportedError("Cannot assign element of immutable Li st.");\n' 492 ' throw new UnsupportedError("Cannot assign element of immutable Li st.");\n'
493 ' }\n', 493 ' }\n',
494 TYPE=self._NarrowInputType(element_type)) 494 TYPE=self._NarrowInputType(element_type))
495 495
496 # TODO(sra): Use separate mixins for mutable implementations of List<T>. 496 # TODO(sra): Use separate mixins for mutable implementations of List<T>.
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 'svg': DartLibrary('svg', template_loader, library_type, output_dir), 969 'svg': DartLibrary('svg', template_loader, library_type, output_dir),
970 'html': DartLibrary('html', template_loader, library_type, output_dir), 970 'html': DartLibrary('html', template_loader, library_type, output_dir),
971 } 971 }
972 972
973 def AddFile(self, basename, library_name, path): 973 def AddFile(self, basename, library_name, path):
974 self._libraries[library_name].AddFile(path) 974 self._libraries[library_name].AddFile(path)
975 975
976 def Emit(self, emitter, auxiliary_dir): 976 def Emit(self, emitter, auxiliary_dir):
977 for lib in self._libraries.values(): 977 for lib in self._libraries.values():
978 lib.Emit(emitter, auxiliary_dir) 978 lib.Emit(emitter, auxiliary_dir)
OLDNEW
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/html/templates/html/impl/impl_Storage.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698