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

Side by Side Diff: pkg/compiler/lib/src/mirrors/dart2js_mirrors.dart

Issue 1205373002: Translate package URIs to resource URIs for diagnostics. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Use resourceUri instead of readableUri in source spans. Created 5 years, 6 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/elements/modelx.dart ('k') | tests/compiler/dart2js/memory_compiler.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 dart2js.mirrors; 5 library dart2js.mirrors;
6 6
7 import 'dart:collection' show UnmodifiableListView, UnmodifiableMapView; 7 import 'dart:collection' show UnmodifiableListView, UnmodifiableMapView;
8 8
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 return getBeginToken(); 186 return getBeginToken();
187 } 187 }
188 188
189 Script getScript() => _element.compilationUnit.script; 189 Script getScript() => _element.compilationUnit.script;
190 190
191 SourceLocation get location { 191 SourceLocation get location {
192 Token beginToken = getFirstToken(); 192 Token beginToken = getFirstToken();
193 Script script = getScript(); 193 Script script = getScript();
194 SourceSpan span; 194 SourceSpan span;
195 if (beginToken == null) { 195 if (beginToken == null) {
196 span = new SourceSpan(script.readableUri, 0, 0); 196 span = new SourceSpan(script.resourceUri, 0, 0);
197 } else { 197 } else {
198 Token endToken = getEndToken(); 198 Token endToken = getEndToken();
199 span = mirrorSystem.compiler.spanFromTokens( 199 span = mirrorSystem.compiler.spanFromTokens(
200 beginToken, endToken, script.readableUri); 200 beginToken, endToken, script.resourceUri);
201 } 201 }
202 return new Dart2JsSourceLocation(script, span); 202 return new Dart2JsSourceLocation(script, span);
203 } 203 }
204 204
205 String toString() => _element.toString(); 205 String toString() => _element.toString();
206 206
207 void _appendCommentTokens(Token commentToken) { 207 void _appendCommentTokens(Token commentToken) {
208 while (commentToken != null && commentToken.kind == COMMENT_TOKEN) { 208 while (commentToken != null && commentToken.kind == COMMENT_TOKEN) {
209 _metadata.add(new Dart2JsCommentInstanceMirror( 209 _metadata.add(new Dart2JsCommentInstanceMirror(
210 mirrorSystem, commentToken.value)); 210 mirrorSystem, commentToken.value));
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 if (!parameter.hasDefaultValue) return null; 474 if (!parameter.hasDefaultValue) return null;
475 ParameterElement parameterElement = parameter._element; 475 ParameterElement parameterElement = parameter._element;
476 Compiler compiler = parameter.mirrorSystem.compiler; 476 Compiler compiler = parameter.mirrorSystem.compiler;
477 return compiler.constants.getConstantForVariable(parameterElement); 477 return compiler.constants.getConstantForVariable(parameterElement);
478 } 478 }
479 479
480 static Mirror getMirrorFromElement(Dart2JsMirror mirror, Element element) { 480 static Mirror getMirrorFromElement(Dart2JsMirror mirror, Element element) {
481 return _convertElementToDeclarationMirror(mirror.mirrorSystem, element); 481 return _convertElementToDeclarationMirror(mirror.mirrorSystem, element);
482 } 482 }
483 } 483 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/elements/modelx.dart ('k') | tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698