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

Side by Side Diff: client/dom/scripts/dartgenerator.py

Issue 9114026: Add map to dart:dom collections. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: x Created 8 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
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, 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 generates Dart APIs from the IDL database.""" 6 """This module generates Dart APIs from the IDL database."""
7 7
8 import emitter 8 import emitter
9 import idlnode 9 import idlnode
10 import logging 10 import logging
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 ' }\n' 1500 ' }\n'
1501 '\n' 1501 '\n'
1502 ' $TYPE last() {\n' 1502 ' $TYPE last() {\n'
1503 ' return this[length - 1];\n' 1503 ' return this[length - 1];\n'
1504 ' }\n' 1504 ' }\n'
1505 '\n' 1505 '\n'
1506 ' void forEach(void f($TYPE element)) {\n' 1506 ' void forEach(void f($TYPE element)) {\n'
1507 ' _Collections.forEach(this, f);\n' 1507 ' _Collections.forEach(this, f);\n'
1508 ' }\n' 1508 ' }\n'
1509 '\n' 1509 '\n'
1510 ' Collection map(f($TYPE element)) {\n'
1511 ' return _Collections.map(this, [], f);\n'
1512 ' }\n'
1513 '\n'
1510 ' Collection<$TYPE> filter(bool f($TYPE element)) {\n' 1514 ' Collection<$TYPE> filter(bool f($TYPE element)) {\n'
1511 ' return _Collections.filter(this, new List<$TYPE>(), f);\n' 1515 ' return _Collections.filter(this, new List<$TYPE>(), f);\n'
1512 ' }\n' 1516 ' }\n'
1513 '\n' 1517 '\n'
1514 ' bool every(bool f($TYPE element)) {\n' 1518 ' bool every(bool f($TYPE element)) {\n'
1515 ' return _Collections.every(this, f);\n' 1519 ' return _Collections.every(this, f);\n'
1516 ' }\n' 1520 ' }\n'
1517 '\n' 1521 '\n'
1518 ' bool some(bool f($TYPE element)) {\n' 1522 ' bool some(bool f($TYPE element)) {\n'
1519 ' return _Collections.some(this, f);\n' 1523 ' return _Collections.some(this, f);\n'
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 Arguments: 1965 Arguments:
1962 info: An OperationInfo object. 1966 info: An OperationInfo object.
1963 """ 1967 """
1964 # TODO(vsm): Handle overloads. 1968 # TODO(vsm): Handle overloads.
1965 self._members_emitter.Emit( 1969 self._members_emitter.Emit(
1966 '\n' 1970 '\n'
1967 ' $TYPE $NAME($ARGS) native;\n', 1971 ' $TYPE $NAME($ARGS) native;\n',
1968 TYPE=info.type_name, 1972 TYPE=info.type_name,
1969 NAME=info.name, 1973 NAME=info.name,
1970 ARGS=info.arg_implementation_declaration) 1974 ARGS=info.arg_implementation_declaration)
OLDNEW
« no previous file with comments | « client/dom/generated/src/wrapping/_Uint8ArrayWrappingImplementation.dart ('k') | client/dom/src/_Collections.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698