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

Side by Side Diff: tests/compiler/dart2js/mock_compiler.dart

Issue 11664006: Make Map.keys/values Iterables. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Add TODO that map.keys should return a Set. 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/html/src/Serialization.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library mock_compiler; 5 library mock_compiler;
6 6
7 import 'dart:uri'; 7 import 'dart:uri';
8 8
9 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api; 9 import '../../../sdk/lib/_internal/compiler/compiler.dart' as api;
10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 /** 130 /**
131 * Used internally to create a library from a source text. The created library 131 * Used internally to create a library from a source text. The created library
132 * is fixed to export its top-level declarations. 132 * is fixed to export its top-level declarations.
133 */ 133 */
134 LibraryElement createLibrary(String name, String source) { 134 LibraryElement createLibrary(String name, String source) {
135 Uri uri = new Uri.fromComponents(scheme: "source", path: name); 135 Uri uri = new Uri.fromComponents(scheme: "source", path: name);
136 var script = new Script(uri, new MockFile(source)); 136 var script = new Script(uri, new MockFile(source));
137 var library = new LibraryElement(script); 137 var library = new LibraryElement(script);
138 parseScript(source, library); 138 parseScript(source, library);
139 library.setExports(library.localScope.values); 139 library.setExports(library.localScope.values.toList());
140 return library; 140 return library;
141 } 141 }
142 142
143 void reportWarning(Node node, var message) { 143 void reportWarning(Node node, var message) {
144 warnings.add(new WarningMessage(node, message.message)); 144 warnings.add(new WarningMessage(node, message.message));
145 } 145 }
146 146
147 void reportError(Node node, var message) { 147 void reportError(Node node, var message) {
148 if (message is String && message.startsWith("no library name found in")) { 148 if (message is String && message.startsWith("no library name found in")) {
149 // TODO(ahe): Fix the MockCompiler to not have this problem. 149 // TODO(ahe): Fix the MockCompiler to not have this problem.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 operator []=(Node node, Element element) { 275 operator []=(Node node, Element element) {
276 map[node] = element; 276 map[node] = element;
277 } 277 }
278 278
279 operator [](Node node) => map[node]; 279 operator [](Node node) => map[node];
280 280
281 void remove(Node node) { 281 void remove(Node node) {
282 map.remove(node); 282 map.remove(node);
283 } 283 }
284 } 284 }
OLDNEW
« no previous file with comments | « sdk/lib/html/src/Serialization.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698