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

Side by Side Diff: lib/compiler/implementation/apiimpl.dart

Issue 10973008: Use translated package url in compiler messages and source maps. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « no previous file | no next file » | 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('leg_apiimpl'); 5 #library('leg_apiimpl');
6 6
7 #import('dart:uri'); 7 #import('dart:uri');
8 8
9 #import('../compiler.dart', prefix: 'api'); 9 #import('../compiler.dart', prefix: 'api');
10 #import('leg.dart', prefix: 'leg'); 10 #import('leg.dart', prefix: 'leg');
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // directly. In effect, we don't support truly asynchronous API. 83 // directly. In effect, we don't support truly asynchronous API.
84 text = provider(translated).value; 84 text = provider(translated).value;
85 } catch (exception) { 85 } catch (exception) {
86 if (node !== null) { 86 if (node !== null) {
87 cancel("$exception", node: node); 87 cancel("$exception", node: node);
88 } else { 88 } else {
89 reportDiagnostic(null, "$exception", api.Diagnostic.ERROR); 89 reportDiagnostic(null, "$exception", api.Diagnostic.ERROR);
90 throw new leg.CompilerCancelledException("$exception"); 90 throw new leg.CompilerCancelledException("$exception");
91 } 91 }
92 } 92 }
93 SourceFile sourceFile = new SourceFile(uri.toString(), text); 93 SourceFile sourceFile = new SourceFile(translated.toString(), text);
94 return new leg.Script(uri, sourceFile); 94 return new leg.Script(uri, sourceFile);
95 } 95 }
96 96
97 Uri translateUri(Uri uri, tree.Node node) { 97 Uri translateUri(Uri uri, tree.Node node) {
98 switch (uri.scheme) { 98 switch (uri.scheme) {
99 case 'package': return translatePackageUri(uri, node); 99 case 'package': return translatePackageUri(uri, node);
100 default: return uri; 100 default: return uri;
101 } 101 }
102 } 102 }
103 103
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 handler(translateUri(span.uri, null), span.begin, span.end, 145 handler(translateUri(span.uri, null), span.begin, span.end,
146 message, kind); 146 message, kind);
147 } 147 }
148 } 148 }
149 149
150 bool get isMockCompilation { 150 bool get isMockCompilation {
151 return mockableLibraryUsed 151 return mockableLibraryUsed
152 && (options.indexOf('--allow-mock-compilation') !== -1); 152 && (options.indexOf('--allow-mock-compilation') !== -1);
153 } 153 }
154 } 154 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698