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

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

Issue 13866010: Correctly compile unresolved for-in loops. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Additional problems found during testing. Created 7 years, 8 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
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
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.
4
5 library dart2js.test.memory_source_file_helper;
6
7 import 'dart:async' show Future;
8 import 'dart:uri' show Uri;
9 export 'dart:uri' show Uri;
10 import 'dart:io';
11 export 'dart:io' show Options;
12
13 export '../../../sdk/lib/_internal/compiler/implementation/apiimpl.dart'
14 show Compiler;
15
16 export '../../../sdk/lib/_internal/compiler/implementation/filenames.dart'
17 show getCurrentDirectory, nativeToUriPath;
18
19 import '../../../sdk/lib/_internal/compiler/implementation/source_file.dart'
20 show SourceFile;
21
22 import '../../../sdk/lib/_internal/compiler/implementation/source_file_provider. dart'
23 show SourceFileProvider;
24
25 export '../../../sdk/lib/_internal/compiler/implementation/source_file_provider. dart'
26 show FormattingDiagnosticHandler;
27
28 class MemorySourceFileProvider extends SourceFileProvider {
29 static Map MEMORY_SOURCE_FILES;
30 Future<String> readStringFromUri(Uri resourceUri) {
31 if (resourceUri.scheme != 'memory') {
32 return super.readStringFromUri(resourceUri);
33 }
34 String source = MEMORY_SOURCE_FILES[resourceUri.path];
35 // TODO(ahe): Return new Future.immediateError(...) ?
36 if (source == null) throw 'No such file $resourceUri';
37 String resourceName = '$resourceUri';
38 this.sourceFiles[resourceName] = new SourceFile(resourceName, source);
39 return new Future.immediate(source);
40 }
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698