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

Side by Side Diff: pkg/compiler/lib/src/source_file_provider.dart

Issue 1196433002: Create and test source mapping for invocations. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 5 years, 5 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
« no previous file with comments | « pkg/compiler/lib/src/native/ssa.dart ('k') | pkg/compiler/lib/src/ssa/builder.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) 2013, the Dart project authors. Please see the AUTHORS file 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 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 source_file_provider; 5 library source_file_provider;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:math' as math; 10 import 'dart:math' as math;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 sourceFiles[resourceUri] = 96 sourceFiles[resourceUri] =
97 new CachingUtf8BytesSourceFile( 97 new CachingUtf8BytesSourceFile(
98 resourceUri, resourceUri.toString(), result); 98 resourceUri, resourceUri.toString(), result);
99 return result; 99 return result;
100 }); 100 });
101 } 101 }
102 102
103 Future/*<List<int> | String>*/ call(Uri resourceUri); 103 Future/*<List<int> | String>*/ call(Uri resourceUri);
104 104
105 relativizeUri(Uri uri) => relativize(cwd, uri, isWindows); 105 relativizeUri(Uri uri) => relativize(cwd, uri, isWindows);
106
107 SourceFile getSourceFile(Uri resourceUri) {
108 return sourceFiles[resourceUri];
109 }
106 } 110 }
107 111
108 class CompilerSourceFileProvider extends SourceFileProvider { 112 class CompilerSourceFileProvider extends SourceFileProvider {
109 Future<List<int>> call(Uri resourceUri) => readUtf8BytesFromUri(resourceUri); 113 Future<List<int>> call(Uri resourceUri) => readUtf8BytesFromUri(resourceUri);
110 } 114 }
111 115
112 class FormattingDiagnosticHandler { 116 class FormattingDiagnosticHandler {
113 final SourceFileProvider provider; 117 final SourceFileProvider provider;
114 bool showWarnings = true; 118 bool showWarnings = true;
115 bool showHints = true; 119 bool showHints = true;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 var onAdd, onClose; 325 var onAdd, onClose;
322 326
323 EventSinkWrapper(this.onAdd, this.onClose); 327 EventSinkWrapper(this.onAdd, this.onClose);
324 328
325 void add(String data) => onAdd(data); 329 void add(String data) => onAdd(data);
326 330
327 void addError(error, [StackTrace stackTrace]) => throw error; 331 void addError(error, [StackTrace stackTrace]) => throw error;
328 332
329 void close() => onClose(); 333 void close() => onClose();
330 } 334 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/ssa.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698